Repository navigation
ci(playwright): give the visual baselines a way to be re-recorded - #33650
chirag-madlani wants to merge 1 commit into
Conversation
The baselines are PNGs rendered by the pinned Linux Playwright image, so they cannot be regenerated on a contributor's machine: a macOS screenshot differs from this one everywhere text is antialiased. There was no way to re-record them in CI either, so a baseline that legitimately goes stale — the page really did change — could only be fixed by hand-editing a binary. In practice it stays red, and a suite that is always red stops being read. `data-quality.png` is there now: 16708 pixels, 2% of the image. The diff is not noise, it is the page. "Data Dimensions" renders 55px lower than the baseline and the coverage donut carries different counts, so the recording predates a change that really happened. `workflow_dispatch` gains an `update_snapshots` flag that re-records instead of comparing and uploads the result as an artifact. It deliberately does not push: accepting a baseline is a judgement about whether the new rendering is the intended one, which belongs to whoever reviews the diff, not to the job that produced it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟡 Medium risk Adds a OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 557 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 2h 23m 45s ⏱️ Max setup 4m 23s · max shard execution 18m 34s · max shard-job elapsed before upload 22m 5s · reporting 5s 🌐 230.89 requests/attempt · 2.23 app boots/UI scenario · 22.53% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Discarding this in favour of a real fix — the premise was wrong. I claimed the baselines could not be regenerated outside CI. They can: CI runs the suite inside Which is this: Replaced by #33655 — waits for skeletons, masks the environment-dependent donut counts, and re-records the baseline in the CI image. |
Why
The visual baselines are PNGs rendered by the pinned Linux Playwright image, so they cannot be regenerated on a contributor's machine — a macOS screenshot differs everywhere text is antialiased. There was no way to re-record them in CI either, so a baseline that legitimately goes stale (the page really did change) could only be fixed by hand-editing a binary. In practice it stays red, and a suite that is always red stops being read.
data-quality.pngis in that state now — 16708 pixels, 2% of the image. I pulled the diff artifact to check it isn't noise:So the recording predates a change that really happened.
What
workflow_dispatchgains anupdate_snapshotsboolean. When set, the suite runs with--update-snapshotsinstead of comparing, and the re-recorded__snapshots__/**are uploaded as an artifact.It deliberately does not push. Accepting a baseline is a judgement about whether the new rendering is the intended one — that belongs to whoever reviews the diff, not to the job that produced it.
One step with one flag rather than a second
if:-gated step, so the recorded run is identical to the comparing run in every other respect.Usage
Actions →
playwright-visual-regression→ Run workflow → tick update_snapshots → downloadvisual-regression-baselines→ commit.Related
#33648 narrows this workflow's paths filter so it stops firing on PRs that only change Playwright specs — which is how
data-quality.pngwent stale unnoticed in the first place: almost nothing triggers this suite, so test-only PRs were the only ones seeing it.🤖 Generated with Claude Code
The PR appears safe to merge; the manual recording path is isolated from normal comparison runs and uploads the expected baseline files.
Summary
This PR adds an opt-in manual workflow mode for regenerating visual-regression baselines in the pinned Playwright container.
workflow_dispatchinput.--update-snapshotsonly when the input is enabled.Reviews (1) · Last reviewed commit: "ci(playwright): give the visual baseline..."