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

Migrate integration tests to Test Kitchen #28

Merged

Conversation

glarizza
Copy link
Contributor

@glarizza glarizza commented Feb 6, 2019

This PR eliminates the existing BATS integration tests and instead
introduces integration tests with Test Kitchen using the
kitchen-terraform and inspec-gcp plugins. The changes made to the
examples were to ensure that all scenarios could be run in parallel, to
correct syntax errors, and to use locals to make testing easier.

This commit contains all changes resulting from copying the module
template over the existing module structure.
This commit eliminates the existing BATS integration tests and instead
introduces integration tests with Test Kitchen using the
kitchen-terraform and inspec-gcp plugins. The changes made to the
examples were to ensure that all scenarios could be run in parallel, to
correct syntax errors, and to use locals to make testing easier.
@glarizza glarizza force-pushed the gl/kitchen_terraform_tests branch 9 times, most recently from cc9eb77 to be1d9a6 Compare February 13, 2019 23:26
Gemfile Outdated Show resolved Hide resolved
test/fixtures/all_examples/test_output.tf Outdated Show resolved Hide resolved
test/fixtures/simulated_ci_environment/README.md Outdated Show resolved Hide resolved
test/fixtures/simulated_ci_environment/README.md Outdated Show resolved Hide resolved
test/fixtures/simulated_ci_environment/README.md Outdated Show resolved Hide resolved
test/integration/multi_vpc/controls/gcloud.rb Outdated Show resolved Hide resolved
test/integration/secondary_ranges/controls/gcloud.rb Outdated Show resolved Hide resolved
test/integration/simple_project/controls/gcloud.rb Outdated Show resolved Hide resolved
test/integration/simple_project/controls/gcp.rb Outdated Show resolved Hide resolved
@glarizza glarizza force-pushed the gl/kitchen_terraform_tests branch from ff9573c to 4913f82 Compare February 14, 2019 20:18
This commit includes changes necessary for enabling the integration
testing CI pipeline being defined in Concourse. The Makefile has been
updated to reference `test/ci_integration.sh` from the `make
test_integration` target which will export the correct Cloud SDK
environment variables based on environment variables coming out of the
CI pipeline (namely `$SERVICE_ACCOUNT_JSON` and `$PROJECT_ID`), handle
teardown of the environment correctly, and allow for the exit code of
the verify step to be communicated back to CI (instead of the exit code
from the destroy step). Also included is the
`test/fixtures/simulated_ci_environment` scenario which can be used to
setup a project and the same dependencies that are established by the CI
pipeline. This will allow a module consumer to be able to test locally
(or via the docker container) in the same way that CI testing is
happening remotely.
@morgante morgante merged commit f43dd92 into terraform-google-modules:master Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants