chore: modify test action

[skip ci]
This commit is contained in:
Marcel S. Henselin 2026-03-26 13:19:03 +01:00
parent 0b5e15d1c5
commit e2d1d4dc91

View file

@ -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 }}