Skip to content

Commit

Permalink
chore(workflows): silence selenium-screenshot archiving error
Browse files Browse the repository at this point in the history
Whenever the `--exclude-tag selenium` tests had a failure the
`upload-artifact` step for Selenium screenshots would also fail.
It's a particular annoyance, because, on failure, Github
automatically expands and presents the `tail` of the last-failed
job. And, in the usual case, this would be `selenium-screenshots`
not the underlying failure.
  • Loading branch information
cweider committed Oct 19, 2024
1 parent 8e4aac4 commit 46e9e29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,22 @@ jobs:
docker exec -e SELENIUM_DEBUG=1 -e SELENIUM_TIMEOUT=30 cl-django
python /opt/courtlistener/manage.py test
cl --verbosity=2 ${{ matrix.tag_flags }} --parallel
- name: cp selenium results from docker to host
- name: Export selenium results from docker to host
if: failure()
run: |
# This is annoying b/c docker cp doesn't support globs. See:
# https://stackoverflow.com/q/35806102/
# https://github.com/moby/moby/issues/7710
mkdir selenium-screenshots
docker exec cl-django bash -c "mkdir /extract && mv /tmp/*-selenium.png /extract"
docker exec cl-django bash -c "mkdir /extract && mv /tmp/*-selenium.png /extract ||:"
docker cp 'cl-django:/extract' selenium-screenshots/
- name: Save selenium screenshot as Github artifacts
uses: actions/upload-artifact@master
if: failure()
with:
name: selenium-screenshots
path: selenium-screenshots/extract
if-no-files-found: ignore

# Cancel the current workflow (tests) for pull requests (head_ref) only. See:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
Expand Down

0 comments on commit 46e9e29

Please sign in to comment.