Skip to content

Commit 2132cfb

Browse files
authored
Fix: mark execution as failed when there are failures (#531)
1 parent c4b5469 commit 2132cfb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/e2e-suite.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
integration-tests:
1010
name: Run integration tests
1111
runs-on: ubuntu-latest
12+
env:
13+
EXIT_STATUS: 0
1214
steps:
1315
- name: Clone Repository
1416
uses: actions/checkout@v3
@@ -39,9 +41,8 @@ jobs:
3941
run: |
4042
timestamp=$(date +'%Y%m%d%H%M')
4143
report_filename="${timestamp}_cli_test_report.xml"
42-
status=0
4344
if ! pytest tests/integration --disable-warnings --junitxml="${report_filename}"; then
44-
echo "Tests failed, but attempting to upload results anyway"
45+
echo "EXIT_STATUS=1" >> $GITHUB_ENV
4546
fi
4647
env:
4748
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}
@@ -67,4 +68,13 @@ jobs:
6768
env:
6869
LINODE_CLI_TOKEN: ${{ secrets.SHARED_DX_TOKEN }}
6970
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
70-
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
71+
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
72+
73+
- name: Test Execution Status Handler
74+
run: |
75+
if [[ "$EXIT_STATUS" != 0 ]]; then
76+
echo "Test execution contains failure(s)"
77+
exit $EXIT_STATUS
78+
else
79+
echo "Tests passed!"
80+
fi

0 commit comments

Comments
 (0)