Cherry-pick #16937 to 7.x: Add build tags for cloud tests #17055
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #16937 to 7.x branch. Original message:
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