diff --git a/tests/integration-tests/ExtraArtifactsAreIncluded.gitlab-ci.yml b/tests/integration-tests/ExtraArtifactsAreIncluded.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..00666a018c953d75ef10af8cfd838b2f65d4e6e0 --- /dev/null +++ b/tests/integration-tests/ExtraArtifactsAreIncluded.gitlab-ci.yml @@ -0,0 +1,42 @@ +variables: + ARTIFACT_FILE_NAME: integration_test_file_artifact + +include: + - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/plan@$CI_COMMIT_SHA + inputs: + image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE + version: $CI_COMMIT_SHA + base_os: $GITLAB_OPENTOFU_BASE_IMAGE_OS + opentofu_version: $OPENTOFU_VERSION + root_dir: $TEST_GITLAB_TOFU_ROOT_DIR + state_name: $TEST_GITLAB_TOFU_STATE_NAME + warning_on_non_empty_plan: true + plan_artifacts: + - $ARTIFACT_FILE_NAME + + # For CI Terraform state cleanup + - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/delete-state@$CI_COMMIT_SHA + inputs: + state_name: $TEST_GITLAB_TOFU_STATE_NAME + rules: [{when: always}] + +stages: [build, cleanup, verify] + +plan: + before_script: + - touch "$ARTIFACT_FILE_NAME" + +verify:plan-job:uploaded-extra-artifact: + stage: verify + needs: ['plan'] + rules: [{when: always}] + image: alpine:latest + script: + - | + if [ -f "$ARTIFACT_FILE_NAME" ]; then + echo 'Success: the extra artifact was uploaded by the plan job.' + exit 0 + else + echo 'Error: the extra artifact was not uploaded by the plan job.' + exit 0 + fi diff --git a/tests/integration.gitlab-ci.yml b/tests/integration.gitlab-ci.yml index 6f3be6dec59e66aba46d447e5132ea6a7c0dd80f..ba4337ec0e59a577ca38c331562356b807639f6a 100644 --- a/tests/integration.gitlab-ci.yml +++ b/tests/integration.gitlab-ci.yml @@ -136,6 +136,7 @@ plan-job-template: matrix: - PIPELINE_NAME: - WarningOnNonEmptyPlan + - ExtraArtifactsAreIncluded GITLAB_OPENTOFU_BASE_IMAGE_OS: - alpine - debian