Skip to content

Commit

Permalink
Publish artifacts from test_output on CI fail (#372)
Browse files Browse the repository at this point in the history
When trying to debug tests on the Github CI, the output from
pytest is often insufficient because some errors are written to
the redirected stderr and stdout of launched applications. This
PR uploads the test_output directory as an artifact of the
workflow on failure.

[ committed by @ashao ]
[ reviewed by @al-rigazzi , @MattToast ]
  • Loading branch information
ashao authored Sep 19, 2023
1 parent bc7b232 commit 0ff2638
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,20 @@ jobs:
echo "SMARTSIM_LOG_LEVEL=debug" >> $GITHUB_ENV
py.test -s --import-mode=importlib -o log_cli=true --cov=$(smart site) --cov-report=xml --cov-config=./tests/test_configs/cov/local_cov.cfg --ignore=tests/full_wlm/ ./tests/
# Upload artifacts on failure, ignoring binary files
- name: Upload Artifact
if: failure()
uses: actions/upload-artifact@v3
with:
name: test_artifact
path: |
tests/test_output
!**/*.so
!**/*.pb
!**/*.pt
!**/core
retention-days: 5

- name: Upload Pytest coverage to Codecov
uses: codecov/codecov-action@v2
with:
Expand Down

0 comments on commit 0ff2638

Please sign in to comment.