Skip to content

Commit 1a6b0e2

Browse files
authored
Add CI to detect stale vis screenshots (#33274)
* Add CI to detect stale vis screenshots * Remove already installed `tree` command * Remove workaround for vis silently adding missing screenshots in CI * Fix stale screenshot detection * Test that CI doesn't silently create new screenshots * Discard changes to packages/shared-components/src/room/composer/Banner/Banner.stories.tsx * Delete stale snapshots
1 parent 8f9953f commit 1a6b0e2

40 files changed

Lines changed: 6 additions & 8 deletions

File tree

.github/workflows/shared-component-visual-tests-netlify.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ jobs:
2525
actions: read
2626
deployments: write
2727
steps:
28-
- name: Install tree
29-
run: "sudo apt-get install -y tree"
30-
3128
- name: Download Diffs
3229
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
3330
with:

.github/workflows/shared-component-visual-tests.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ jobs:
4545
working-directory: packages/shared-components
4646
run: "pnpm test:storybook --run"
4747

48-
# Workaround for vis silently adding new baselines if they didn't exist
49-
# Can be removed once https://github.com/repobuddy/visual-testing/issues/516 is released
50-
- run: |
51-
git add -N .
52-
git diff --exit-code
48+
- name: Detect stale screenshots
49+
run: |
50+
if diff -rq __baselines__ __results__ | grep "^Only in __baselines__"; then
51+
exit 1
52+
fi
53+
working-directory: packages/shared-components/__vis__/linux
5354

5455
- name: Upload received images & diffs
5556
if: always()

0 commit comments

Comments
 (0)