Skip to content

Commit

Permalink
Upload failed visual regression tests if they fail
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-weindel committed Dec 12, 2023
1 parent d6b0d7d commit 5906199
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 5906199

Please sign in to comment.