Skip to content

Commit

Permalink
Fix: mark execution as failed when there are failures (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykim-akamai authored Oct 10, 2023
1 parent c4b5469 commit 2132cfb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/e2e-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
env:
EXIT_STATUS: 0
steps:
- name: Clone Repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -39,9 +41,8 @@ jobs:
run: |
timestamp=$(date +'%Y%m%d%H%M')
report_filename="${timestamp}_cli_test_report.xml"
status=0
if ! pytest tests/integration --disable-warnings --junitxml="${report_filename}"; then
echo "Tests failed, but attempting to upload results anyway"
echo "EXIT_STATUS=1" >> $GITHUB_ENV
fi
env:
LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }}
Expand All @@ -67,4 +68,13 @@ jobs:
env:
LINODE_CLI_TOKEN: ${{ secrets.SHARED_DX_TOKEN }}
LINODE_CLI_OBJ_ACCESS_KEY: ${{ secrets.LINODE_CLI_OBJ_ACCESS_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}
LINODE_CLI_OBJ_SECRET_KEY: ${{ secrets.LINODE_CLI_OBJ_SECRET_KEY }}

- name: Test Execution Status Handler
run: |
if [[ "$EXIT_STATUS" != 0 ]]; then
echo "Test execution contains failure(s)"
exit $EXIT_STATUS
else
echo "Tests passed!"
fi

0 comments on commit 2132cfb

Please sign in to comment.