Skip to content

[WIP] feat(snapshots): Add Docker-based snapshot generation for CI parity#116254

Draft
NicoHinderling wants to merge 1 commit into
masterfrom
feat/docker-snapshot-generation
Draft

[WIP] feat(snapshots): Add Docker-based snapshot generation for CI parity#116254
NicoHinderling wants to merge 1 commit into
masterfrom
feat/docker-snapshot-generation

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

Adds bin/run-snapshots-docker, a shell script that runs pnpm run snapshots inside Playwright's official Ubuntu 24.04 Docker image — the same OS and font rendering stack (FreeType) that CI uses.

Problem: Running pnpm run snapshots on 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=none and --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 caches node_modules so only the first run is slow (~90s), subsequent runs take ~35s.

Usage:

./bin/run-snapshots-docker
sentry-cli snapshots diff ./snapshots-base/ .artifacts/snapshots

Also adds .gitignore entries for local snapshot working directories (diff-output/, snapshots-base/, snapshots-head/, .pnpm-store/).

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>
@NicoHinderling NicoHinderling changed the title feat(snapshots): Add Docker-based snapshot generation for CI parity [WIP] feat(snapshots): Add Docker-based snapshot generation for CI parity May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant