From f2ae87bc8f64e0b1035cb3fb70b8a88b04f5fb10 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Tue, 21 Jul 2026 15:55:53 +0700 Subject: [PATCH] test(e2e): stop a host run from writing unusable visual baselines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nothing enforced the container requirement — only a comment mentioned it. Running the visual project on a developer machine writes `*-visual-darwin.png` next to the linux baselines: new files CI never reads, so it stays red while the repo collects junk and nothing says why. Fail up front with the command to use instead. Co-Authored-By: Claude Fable 5 --- frontend/e2e/playwright.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/e2e/playwright.config.ts b/frontend/e2e/playwright.config.ts index cbcb5384..619049ae 100644 --- a/frontend/e2e/playwright.config.ts +++ b/frontend/e2e/playwright.config.ts @@ -10,6 +10,14 @@ const isCI = Boolean(process.env.CI); // that never match CI pixels. const isVisual = process.env.E2E_VISUAL === '1'; +// Baselines are linux-suffixed, so a host run writes `*-visual-darwin.png` beside +// them: new files CI never reads, leaving it red with nothing to explain why. +if (isVisual && process.platform !== 'linux') { + throw new Error( + `visual snapshots must run in the pinned container — use e2e/tools/run-visual.sh (got platform "${process.platform}")`, + ); +} + // `vite preview` listens on VITE_PORT + 100 and reuses the dev proxy config. const PREVIEW_PORT = 8100;