-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add build tags for cloud tests #16937
Conversation
Pinging @elastic/integrations-platforms (Team:Platforms) |
@kaiyan-sheng @narph I would like to have your feedback about this change before opening for review. |
This reverts commit bb39a97.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, love to see this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Add build tags to AWS and Azure integration tests, and make tests fail if they cannot get a working configuration. Add support for a `TEST_TAGS` environment variable in mage targets that add additional build tags to go tests calls. When `TEST_TAGS` includes a cloud provider, it is expected that valid credentials to run these tests are available in the environment, if not, tests will fail. This is intentional, to avoid skipping tests by mistake due to some misconfiguration in CI. (cherry picked from commit 1345a97)
Add build tags to AWS and Azure integration tests, and make tests fail if they cannot get a working configuration. Add support for a `TEST_TAGS` environment variable in mage targets that add additional build tags to go tests calls. When `TEST_TAGS` includes a cloud provider, it is expected that valid credentials to run these tests are available in the environment, if not, tests will fail. This is intentional, to avoid skipping tests by mistake due to some misconfiguration in CI. (cherry picked from commit 1345a97)
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.
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.
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)
What does this PR do?
Add build tags to AWS and Azure integration tests, and make tests fail if they cannot get a working configuration.
Add support for a
TEST_TAGS
environment variable in mage targets that add additional build tags togo tests
calls.When
TEST_TAGS
includes a cloud provider, it is expected that valid credentials to run these tests are available in the environment, if not, tests will fail. This is intentional, to avoid skipping tests by mistake due to some misconfiguration in CI.Why is it important?
To add support of integration testing of cloud features in CI we need some way to select what tests to run in a way that can be easily defined in jenkins configuration files. With
TEST_TAGS
we can do this selection of tests.Checklist
I have made corresponding changes to the documentation(We need to review documenation about running tests in general, we also need to review how to document mage targets and supported environment variables)How to test this PR locally
Run integration tests for cloud features with
go test
:go test --tags=integration,aws
, AWS integration tests should be run, with credentials they should work, without credentials they should fail.Repeat the steps with
mage goIntegTest
:TEST_TAGS
, cloud tests shouldn't be run.TEST_TAGS=aws
, AWS integration tests should be run, with credentials they should work, without credentials they should fail.Related issues