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 #16937 to 7.x: Add build tags for cloud tests #17055

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Mar 17, 2020

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 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.

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

  • 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 (We need to review documenation about running tests in general, we also need to review how to document mage targets and supported environment variables)
  • 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

Run integration tests for cloud features with go test:

  • Without corresponding tags, tests shouldn't be run.
  • With 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:

  • Without TEST_TAGS, cloud tests shouldn't be run.
  • With TEST_TAGS=aws, AWS integration tests should be run, with credentials they should work, without credentials they should fail.

Related issues

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)
@jsoriano jsoriano merged commit 16681f6 into elastic:7.x Mar 17, 2020
@jsoriano jsoriano deleted the backport_16937_7.x branch March 17, 2020 16:09
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