Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #17075 to 7.x: Add support of TEST_TAGS in python tests #17122

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Mar 19, 2020

Cherry-pick of PR #17075 to 7.x branch. Original message:

What does this PR do?

Add a tag(tag) decorator that skips a test if the tag is not included
in the comma-separated list of TEST_TAGS environment variable.
This offers an initial support for the similar implementation added for
mage in #16937.

Why is it important?

#16937 was intended for cloud tests, where we only have go-based
integration tests. But we have found similar needings in some services
like oracle, where we need an image that we cannot distribute. In that
case we need a similar approach to run the test only in our Jenkins
instances, where the image is available.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

  • Tag a python test with @metricbeat.tag('sometag').
  • Check that the test is skipped if TEST_TAGS is not used.
  • Check that the test is executed if TEST_TAGS environment variable includes sometag (e.g: TEST_TAGS=sometag or TEST_TAGS=sometag,foo.

Related issues

Use cases

  • Run certain tests that require some application or credentials to be available only where they are.

Add a `tag(tag)` decorator that skips a test if the tag is not included
in the comma-separated list of `TEST_TAGS` environment variable.
This offers an initial support for the similar implementation added for
mage in elastic#16937.

(cherry picked from commit 3bf05f5)
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a changelog in the developer changelog for this? The backport looks good.

@jsoriano jsoriano merged commit cfcd8cf into elastic:7.x Mar 19, 2020
@jsoriano jsoriano deleted the backport_17075_7.x branch March 19, 2020 19:48
@jsoriano
Copy link
Member Author

Do we need a changelog in the developer changelog for this?

Good point, changelog entry added in #17140.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants