Skip to content

Commit

Permalink
Add image checks in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Brody committed Sep 16, 2024
1 parent 7f091f5 commit 807303b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,31 @@ jobs:
fluxbox >/dev/null 2>&1 & # needed for window resizing in Testcafe
npm ci
npx ts-node test/ci_proxy.ts &
npx testcafe -e chromium test/${{ matrix.test-file }}
npx testcafe -e "chromium '--window-size=1400,800' --hide-scrollbars" test/${{ matrix.test-file }}
working-directory: react
- uses: actions/upload-artifact@v4
with:
name: test-screenshots-${{ matrix.test-file }}
path: react/screenshots

check-screenshots:
runs-on: ubuntu-22.04
needs: [build-and-push-image, run-e2e-tests]
container:
image: ghcr.io/${{ needs.build-and-push-image.outputs.image_tag }}
strategy:
fail-fast: false
matrix:
test-file: ${{ fromJson(needs.list-e2e-tests.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: test-screenshots-${{ matrix.test-file }}
path: react/screenshots
- name: Check screenshots
run: python3 tests/check_images.py
- uses: actions/upload-artifact@v4
with:
name: screenshot-deltas-${{ matrix.test-file }}
path: react/delta
1 change: 1 addition & 0 deletions tests/check_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def test_all_same(reference="reference_test_screeshots", actual="react/screensho
errors += not test_paths(reference_path, actual_path, delta_path)
if errors:
print(f"{errors} errors found")
exit(1)
else:
print("All tests passed")
if __name__ == "__main__":
Expand Down

0 comments on commit 807303b

Please sign in to comment.