chore: modify test action
[skip ci]
This commit is contained in:
parent
5a5752d902
commit
66b3858351
3 changed files with 31 additions and 16 deletions
22
.github/actions/acc_test/action.yaml
vendored
22
.github/actions/acc_test/action.yaml
vendored
|
|
@ -70,6 +70,10 @@ outputs:
|
|||
value: ${{ steps.testrun.result }}
|
||||
description: "the output of the tests"
|
||||
|
||||
status:
|
||||
value: ${{ steps.testrun.status }}
|
||||
description: "the status of the tests"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
|
@ -230,11 +234,15 @@ runs:
|
|||
echo "::endgroup::"
|
||||
set -e
|
||||
echo "::group::go test result"
|
||||
if [ $? -ne 0 ]; then
|
||||
|
||||
if [[ $(cat acc_test_run.log | grep "FAIL") ]]; then
|
||||
echo "Test failed, see acc_test_run.log for details"
|
||||
res=$(cat acc_test_run.log | grep -v "=== RUN" | grep -v "\-\-\- PASS" | grep -v "=== CONT" | grep -v "=== PAUSE")
|
||||
echo "result=${res}" >> "$GITHUB_OUTPUT"
|
||||
echo "result=FAIL: ${res}" >> "$GITHUB_OUTPUT"
|
||||
echo "status=FAILED" >> "$GITHUB_OUTPUT"
|
||||
exit 1
|
||||
else
|
||||
echo "status=SUCCESS" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
env:
|
||||
|
|
@ -246,19 +254,9 @@ runs:
|
|||
TF_ACC_KEK_KEY_VERSION: ${{ inputs.tf_acc_kek_key_version }}
|
||||
TF_ACC_KEK_SERVICE_ACCOUNT: ${{ inputs.tf_acc_kek_service_account }}
|
||||
|
||||
- name: Artifact upload start
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::group::artifact upload"
|
||||
|
||||
- name: Upload test log artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: acc_test.log
|
||||
path: "stackit/acc_test_run.log"
|
||||
|
||||
- name: Artifact upload finish
|
||||
shell: bash
|
||||
run: |
|
||||
echo "::endgroup::"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue