Skip to content
Snippets Groups Projects
Commit 7af406a6 authored by João Alexandre Cunha's avatar João Alexandre Cunha
Browse files

Merge branch 'integration-tests' into 'master'

Improve integration test coverage

See merge request https://gitlab.com/gitlab-org/terraform-images/-/merge_requests/171



Merged-by: default avatarJoão Alexandre Cunha <j.a.cunha@gmail.com>
Approved-by: default avatarTiger Watson <twatson@gitlab.com>
Approved-by: default avatarJoão Alexandre Cunha <j.a.cunha@gmail.com>
Reviewed-by: default avatarTiger Watson <twatson@gitlab.com>
Co-authored-by: default avatarTimo Furrer <tfurrer@gitlab.com>
parents 3d4bffd6 d38d3919
No related branches found
No related tags found
No related merge requests found
......@@ -390,19 +390,22 @@ test-no-wrapper:
- test $FAILED = true
- 'cat /tmp/output.txt | grep "Error: Backend initialization required, please run \"terraform init\""'
integration-test:
integration-test-template:
stage: test-integration
variables:
TERRAFORM_VERSION: $STABLE_VERSION
TF_STATE_NAME: ci-$CI_JOB_NAME-$CI_PIPELINE_IID
TF_STATE_NAME: ci-integration-test-template-$CI_PIPELINE_IID-$CI_NODE_INDEX
TF_CACHE_KEY: default
TF_ROOT: tests
trigger:
include: .gitlab/integration-test/Test-Terraform.gitlab-ci.yml
include: .gitlab/integration-test/Test-$TEMPLATE
strategy: depend
rules:
- if: '$CI_PROJECT_PATH == "gitlab-org/terraform-images"'
- if: '$CI_MERGE_REQUEST_EVENT_TYPE == "merge_train"'
parallel:
matrix:
- TEMPLATE: [Terraform.gitlab-ci.yml, Terraform.latest.gitlab-ci.yml]
release:
extends: .versions
......
......@@ -12,5 +12,10 @@ image: "$BUILD_IMAGE_NAME"
# This prevents stalled manual pipelines, but more importantly tests
# the `apply` wrapper.
deploy:
rules:
- when: always
destroy:
extends: .terraform:destroy
rules:
- when: always
\ No newline at end of file
workflow:
rules:
- if: '$CI_PROJECT_PATH == "gitlab-org/terraform-images"'
include:
- template: Terraform.latest.gitlab-ci.yml
image: "$BUILD_IMAGE_NAME"
.run-always:
rules:
- when: always
fmt:
rules: !reference [.run-always, rules]
validate:
rules: !reference [.run-always, rules]
build:
rules: !reference [.run-always, rules]
# The `terraform apply` should always happen for the integration tests.
# This prevents stalled manual pipelines, but more importantly tests
# the `apply` wrapper.
deploy:
rules: !reference [.run-always, rules]
destroy:
extends: .terraform:destroy
rules: !reference [.run-always, rules]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment