diff --git a/.github/actions/acc_test/action.yaml b/.github/actions/acc_test/action.yaml index 23bcd84e..800293dc 100644 --- a/.github/actions/acc_test/action.yaml +++ b/.github/actions/acc_test/action.yaml @@ -204,6 +204,7 @@ runs: fi echo "Running acceptance tests for the terraform provider" + set +e cd stackit || exit 1 TF_ACC=1 \ TF_ACC_PROJECT_ID=${TF_ACC_PROJECT_ID} \ @@ -214,7 +215,15 @@ runs: TF_ACC_KEK_KEY_RING_ID=${TF_ACC_KEK_KEY_RING_ID} \ TF_ACC_KEK_KEY_VERSION=${TF_ACC_KEK_KEY_VERSION} \ TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \ - go test -v ${{ inputs.test_file }} -timeout=${{ inputs.test_timeout_string }} + go test -v ${{ inputs.test_file }} -timeout=${{ inputs.test_timeout_string }} | tee -a acc_test_run.log + set -e + echo "::endgroup::" + echo "::group::go test result" + if [ $? -ne 0 ]; then + echo "Test failed, see acc_test_run.log for details" + cat acc_test_run.log | grep -v "=== RUN" | grep -v "--- PASS" | grep -v "=== CONT" | grep -v "=== PAUSE" + exit 1 + fi echo "::endgroup::" env: TF_ACC_PROJECT_ID: ${{ inputs.project_id }} @@ -243,7 +252,7 @@ runs: # testArguments: "./... -timeout ${{ inputs.test_timeout_string }}" # moduleDirectory: "stackit" - - name: Run acceptance tests + - name: Run all acceptance tests if: ${{ inputs.test_file == '' }} shell: bash run: | @@ -258,6 +267,7 @@ runs: echo "Running acceptance tests for the terraform provider" cd stackit || exit 1 + set +e TF_ACC=1 \ TF_ACC_PROJECT_ID=${TF_ACC_PROJECT_ID} \ TF_ACC_REGION=${TF_ACC_REGION} \ @@ -267,7 +277,15 @@ runs: TF_ACC_KEK_KEY_RING_ID=${TF_ACC_KEK_KEY_RING_ID} \ TF_ACC_KEK_KEY_VERSION=${TF_ACC_KEK_KEY_VERSION} \ TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \ - go test -v ./... -timeout=${{ inputs.test_timeout_string }} + go test -v ./... -timeout=${{ inputs.test_timeout_string }} | tee -a acc_test_run.log + set -e + echo "::endgroup::" + echo "::group::go test result" + if [ $? -ne 0 ]; then + echo "Test failed, see acc_test_run.log for details" + cat acc_test_run.log | grep -v "=== RUN" | grep -v "--- PASS" | grep -v "=== CONT" | grep -v "=== PAUSE" + exit 1 + fi echo "::endgroup::" env: TF_ACC_PROJECT_ID: ${{ inputs.project_id }}