Skip to content

Commit

Permalink
Upload failed Visual Regression tests (#106)
Browse files Browse the repository at this point in the history
Sometimes visual regression test fail on GitHub actions but pass locally
even in `--ci` mode!

See included README update. The `failed-results` directory is now
uploaded as an artifact of at the GitHub Actions workflow so that they
can be examined.
  • Loading branch information
frank-weindel authored Dec 12, 2023
2 parents d6b0d7d + 5906199 commit 8489634
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ jobs:
run: pnpm run test:visual --color
env:
RUNTIME_ENV: ci

- name: Upload failed-results as artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: failed-results
path: visual-regression/failed-results/
12 changes: 12 additions & 0 deletions visual-regression/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ to speed up the time it takes to verify if your changes cause any regressions.
3. Before pushing new commits to the remote PR branch, compare your changes
to the snapshots you took prior to starting your PR: `pnpm test:visual`

## GitHub Actions Workflow

The Visual Regression Tests run as a status check on every pull request update
via the GitHub Actions workflow defined in `.github/workflows/tests.yml`. The tests
that run are compared with the snapshots in the `certified-snapshots/chromium-ci`
directory.

When tests failed, the failure results that you normally find in
`visual-regression/failed-results` are uploaded to the workflow run as a zip file
artifact named **failed-results**. See [Where does the upload go?](https://github.com/actions/upload-artifact#where-does-the-upload-go)
for more on how to find it.

## How to define Snapshots

The Snapshots themselves are defined in the individual Example Tests located in the
Expand Down

0 comments on commit 8489634

Please sign in to comment.