Skip to content
Snippets Groups Projects
Unverified Commit 0f7c0a8b authored by Timo Furrer's avatar Timo Furrer
Browse files

Add integration tests

parent 2dddabc6
No related branches found
No related tags found
No related merge requests found
......@@ -7,11 +7,13 @@
# stages: [build, test, release]
include:
- local: tests/unit-tests.gitlab-ci.yml
- local: tests/unit.gitlab-ci.yml
- local: tests/integration.gitlab-ci.yml
stages:
- build
- test
- test-integration
.opentofu-versions:
parallel:
......
workflow:
rules:
- if: '$CI_PROJECT_PATH == "gitlab-org/terraform-images"'
include:
- template: Terraform.gitlab-ci.yml
image: "$IMAGE"
# The `terraform apply` should always happen for the integration tests.
# This prevents stalled manual pipelines, but more importantly tests
# the `apply` wrapper.
deploy:
rules:
- when: always
destroy:
extends: .terraform:destroy
rules:
- when: always
workflow:
rules:
- if: '$CI_PROJECT_PATH == "gitlab-org/terraform-images"'
include:
- template: Terraform.latest.gitlab-ci.yml
default:
image: "$IMAGE"
.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]
include:
- component: gitlab.com/$CI_PROJECT_PATH/full-pipeline@$CI_COMMIT_SHA
component:
stage: test-integration
variables:
IMAGE: $OPENTOFU_IMAGE_NAME
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
TF_STATE_NAME: ci-integration-$CI_PIPELINE_IID-$CI_NODE_INDEX
TF_ROOT: tests
trigger:
include: tests/integration-test/$PIPELINE
strategy: depend
rules:
- if: '$CI_PROJECT_PATH == "components/opentofu"'
#- if: '$CI_MERGE_REQUEST_EVENT_TYPE == "merge_train"'
parallel:
matrix:
- PIPELINE: [Defaults.gitlab-ci.yml]
{"Modules":[{"Key":"","Source":"","Dir":"."},{"Key":"random_pet","Source":"./modules/random-pet","Dir":"modules/random-pet"}]}
\ No newline at end of file
......@@ -324,21 +324,3 @@ tofu-test-no-wrapper:
- cat /tmp/output.txt
- test $FAILED = true
- 'cat /tmp/output.txt | grep "Error: Backend initialization required, please run \"tofu init\""'
# tofu-integration-test-template:
# stage: test-integration
# variables:
# IMAGE: $TOFU_IMAGE_NAME
# # Hard-coded for now since there's no tofu stable version yet
# TOFU_VERSION: "1.6"
# TF_STATE_NAME: ci-tofu-integration-test-template-$CI_PIPELINE_IID-$CI_NODE_INDEX
# TF_ROOT: tests
# trigger:
# 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]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment