Repository navigation
test: fix and future-proof the darwin blog-index baselines - #363
Conversation
35e92c6 ("blog: turn the index into a Payload guide gateway", #348) redesigned /blog but its snapshot update only refreshed the linux baselines, so the darwin pair kept the pre-redesign rendering. CI is linux, so pr-gate stayed green while local macOS `pnpm test:release` failed both blog-index cases (~35% pixel diff on desktop). Re-minted with `--update-snapshots=changed` against the production server, so only the two mismatching darwin files were rewritten — the blog-article baselines and every `*-linux.png` are untouched. Verified the new PNGs depict the current guide-gateway index (eyebrow, dark installation card, two guide cards) and that the suite passes clean. Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
components-visual, templates-visual, and blog-visual each carried their own copy of the same dance: derive the `-<project>-<platform>.png` suffix, treat `all`/`changed` as updating, skip a case whose current-platform baseline is absent, and fail the coverage guard once the platform is minted. Three copies, three slightly different messages, and the shared rationale duplicated in three header comments. Extract `expectCompletePlatformBaselines` and `skipWithoutPlatformBaseline` into tests/e2e/support/visual-baselines.ts and give each spec a `VisualBaselines` descriptor instead. Behaviour is unchanged: blog keeps its `requireMinted` escalation (linux CI must fail rather than skip an empty baseline set), and the other two keep skipping. Each spec now derives its screenshot name and its guarded stem from one `baselineStem` helper, so the name the guard checks can't drift from the name Playwright writes. The helper's doc comment also records what neither guard can catch — a baseline that exists but is stale, which is how the blog index kept a pre-redesign darwin image through a green pr-gate. Two knock-on updates: - tests/int/blog-visual-system.int.spec.ts pinned the old inline `requiresMintedBaselines` line. Re-pinned to both halves of the moved behaviour (the spec declaring `requireMinted`, the helper acting on it) rather than dropped. - The Field Journal figure for visual-regression-component-registry embeds a live 14-line excerpt of components-visual, so it was regenerated with `pnpm blog:visuals:figures`. Only the hidden data-evidence attribute moved; the visible figure and the article prose are unchanged, and the other 26 figures regenerated byte-identically. Verified: lint, tsc, test:int (341 passed), and all three visual specs (69 + 62 + 5 passed, same counts as before). Also forced the missing- baseline path by holding one PNG back — the coverage guard failed naming the stem and the affected case skipped, so the guards still guard. Co-Authored-By: Claude Opus 5 <[email protected]>
Nothing in CI can catch a half-minted visual change: the specs' coverage guard fails on a missing baseline but never a stale one, and pr-gate only renders linux. A linux-only mint therefore leaves the darwin image showing the old design — green on every PR, failing only for whoever next runs the gate on a Mac (exactly what 35e92c6 did to the blog index). Add a "Visual baselines" section to CONTRIBUTING.md stating the rule, how to mint each platform, and the reviewer heuristic: a diff touching `*-chromium-linux.png` without the matching `*-chromium-darwin.png` (or vice versa) is suspect. Add the paired update to the pull-request checklist. Co-Authored-By: Claude Opus 5 <[email protected]>
Three commits: fix the stale baselines, remove the duplication that made the guards hard to reason about, and write down the rule that would have caught it.
1.
test:re-mint the darwin blog-index visual baselinespnpm test:releasefails locally on macOS with two failures intests/e2e/blog-visual.e2e.spec.ts(blog-index-desktop, ratio 0.35 different;blog-index-mobile).35e92c6 ("blog: turn the index into a Payload guide gateway", #348) redesigned
/blogbut its snapshot update touched only the linux baselines — its stat islinux:2 darwin:0. The darwin pair kept the pre-redesign rendering ("Build notes and release stories" + post grid). CI is linux, sopr-gatehas been green throughout; only local macOS runs fail.Re-minted with
--update-snapshots=changed, which rewrites only mismatching cases — theblog-article-*baselines and every*-linux.pngare untouched.Verified by inspecting the PNGs rather than accepting the diff blind: both depict the current guide-gateway index (eyebrow,
Payload CMS block and installer guidesH1, dark installation-guide card carryingnpx payload-components add hero-basic, block-wiring / troubleshooting cards), matching the committed linux baselines modulo macOS font rasterization. Sizes now sit alongside the linux pair (118 KB / 67 KB vs 116 KB / 70 KB) instead of the old 274 KB / 85 KB.2.
test:share the platform-baseline guards across the visual specscomponents-visual,templates-visual, andblog-visualeach carried the same logic: derive the-<project>-<platform>.pngsuffix, treatall/changedas updating, skip a case whose current-platform baseline is absent, fail the coverage guard once the platform is minted. Three copies, three slightly different messages, the rationale duplicated in three header comments.Extracted into
tests/e2e/support/visual-baselines.tsasexpectCompletePlatformBaselines+skipWithoutPlatformBaseline, with each spec passing aVisualBaselinesdescriptor. Behaviour is unchanged — blog keeps itsrequireMintedescalation (linux CI must fail rather than skip an empty baseline set); the other two keep skipping. Each spec now derives both its screenshot name and its guarded stem from onebaselineStem, so the name the guard checks can't drift from the name Playwright writes.Two knock-on updates, both intentional:
tests/int/blog-visual-system.int.spec.tspinned the old inlinerequiresMintedBaselinesline. Re-pinned to both halves of the moved behaviour rather than dropped.visual-regression-component-registryembeds a live 14-line excerpt ofcomponents-visual, so it was regenerated withpnpm blog:visuals:figures. Only the hiddendata-evidenceattribute moved — the visible figure and the article prose are unchanged, and the other 26 figures regenerated byte-identically.3.
docs:require paired darwin/linux baseline mintsNothing in CI can catch a half-minted visual change: the coverage guard fails on a missing baseline, never a stale one, and
pr-gateonly renders linux. Added a "Visual baselines" section toCONTRIBUTING.mdwith the rule, the mint commands, and the reviewer heuristic — a diff touching*-chromium-linux.pngwithout the matching*-chromium-darwin.png(or vice versa) is suspect — plus a line in the PR checklist.Verification
dev+ commit 1: green (GATE_EXIT=0read from the log, nottail's code) — int 341 passed, e2e 39 + 69 + 62 + 93 passed across the four batches.tsc --noEmit,test:int(341 passed, unchanged), and all three visual specs (69 + 62 + 5 passed — identical counts to the pre-refactor gate).blog-index-desktopwith the new actionable hint while the affected case skipped. Baseline restored.siteUrlonly feeds metadata/JSON-LD/RSS on these routes).Note for reviewers: commit 1 is unverifiable by CI —
pr-gateis linux and never renders the changed files. It was validated on macOS.