Skip to content

Commit ca4674b

Browse files
authored
fix(ci): Warn instead of fail on unused syrupy snapshots in playwright runs (#2334)
1 parent 76cfb02 commit ca4674b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,13 @@ install-rsconnect: FORCE
230230
# All end-to-end tests with playwright
231231
# `--timeout` bounds each test so a hang fails fast with a thread-stack dump
232232
# instead of consuming the whole job.
233+
# `--snapshot-warn-unused` because CI runs each browser and pytest-shard shard
234+
# as a separate partial job; syrupy (>=5.5.0, under xdist) would otherwise fail
235+
# the job for snapshots that belong to the tests running in the *other* jobs.
236+
# Stale snapshots can still be cleaned up with an all-browser, unsharded run
237+
# using `--snapshot-update`.
233238
playwright: install-playwright ## All end-to-end tests with playwright; (TEST_FILE="" from root of repo)
234-
pytest $(PLAYWRIGHT_VERBOSE) --timeout=$(PLAYWRIGHT_TEST_TIMEOUT) --timeout-method=$(PLAYWRIGHT_TEST_TIMEOUT_METHOD) -o faulthandler_timeout=$(PLAYWRIGHT_FAULTHANDLER_TIMEOUT) $(TEST_FILE) $(PYTEST_BROWSERS)
239+
pytest $(PLAYWRIGHT_VERBOSE) --snapshot-warn-unused --timeout=$(PLAYWRIGHT_TEST_TIMEOUT) --timeout-method=$(PLAYWRIGHT_TEST_TIMEOUT_METHOD) -o faulthandler_timeout=$(PLAYWRIGHT_FAULTHANDLER_TIMEOUT) $(TEST_FILE) $(PYTEST_BROWSERS)
235240

236241
playwright-debug: install-playwright ## All end-to-end tests, chrome only, headed; (TEST_FILE="" from root of repo)
237242
pytest -c tests/playwright/playwright-pytest.ini $(TEST_FILE)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test = [
8686
"pytest-rerunfailures",
8787
"pytest-cov",
8888
"coverage",
89-
"syrupy>=4.7.1",
89+
"syrupy>=5.5.1",
9090
"psutil",
9191
"astropy",
9292
"suntime",

0 commit comments

Comments
 (0)