[WIP] feat(snapshots): Add Docker-based snapshot generation for CI parity#116254
Draft
NicoHinderling wants to merge 1 commit into
Draft
[WIP] feat(snapshots): Add Docker-based snapshot generation for CI parity#116254NicoHinderling wants to merge 1 commit into
NicoHinderling wants to merge 1 commit into
Conversation
Snapshot generation on macOS produces ~314/400 false positives when diffed against CI output due to CoreText vs FreeType font rendering differences. This script runs `pnpm run snapshots` inside the same Playwright Docker image (Ubuntu 24.04) that CI uses, eliminating cross-platform rendering discrepancies. Uses a Docker named volume to cache node_modules between runs. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
bin/run-snapshots-docker, a shell script that runspnpm run snapshotsinside Playwright's official Ubuntu 24.04 Docker image — the same OS and font rendering stack (FreeType) that CI uses.Problem: Running
pnpm run snapshotson macOS produces ~314/400 false positive diffs against CI-generated base snapshots, because macOS CoreText and Linux FreeType produce slightly different subpixel antialiasing even with--font-render-hinting=noneand--disable-skia-runtime-opts.Solution: Run snapshot generation in a Docker container matching CI's environment (
mcr.microsoft.com/playwright:v1.58.2-noble). This eliminates all cross-platform rendering differences. A Docker named volume cachesnode_modulesso only the first run is slow (~90s), subsequent runs take ~35s.Usage:
Also adds
.gitignoreentries for local snapshot working directories (diff-output/,snapshots-base/,snapshots-head/,.pnpm-store/).