From 3301aba30ec80a37abad60d57709e75a1f045f8e Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Thu, 13 Aug 2026 17:06:50 +0200 Subject: [PATCH] fix: the parity harness finds Chromium on any platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit playwright-core resolves its own installed browser, so the hand-rolled ~/.cache/ms-playwright scan and its chrome-linux/chrome path can go — that directory and binary name are Linux-only, and the harness threw before rendering anything anywhere else. PARITY_CHROME still overrides. --- tests/render-parity/run.mjs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tests/render-parity/run.mjs b/tests/render-parity/run.mjs index 98dcc81..0f20ee7 100644 --- a/tests/render-parity/run.mjs +++ b/tests/render-parity/run.mjs @@ -11,7 +11,7 @@ import { chromium } from 'playwright-core'; const HERE = dirname(fileURLToPath(import.meta.url)); const ROOT = resolve(HERE, '../..'); -const CHROME = process.env.PARITY_CHROME ?? newestChromium(); +const CHROME = process.env.PARITY_CHROME ?? chromium.executablePath(); const PORT = +(process.env.PARITY_PORT ?? 5199); // reuse a dev server already up const PAGE_GAP = 20; // pageBreaks.ts const PT_MM = 25.4 / 72; @@ -19,17 +19,6 @@ const PX_MM = 25.4 / 96; const LINE_TOL_MM = 1.2; // words within this vertical span are one line const POS_TOL_MM = 1.0; // reported as a position difference beyond this -// `playwright-core install chromium` names the directory after its own build number, -// so take the highest one present. PARITY_CHROME overrides it. -function newestChromium() { - const base = join(process.env.HOME, '.cache/ms-playwright'); - const builds = (existsSync(base) ? readdirSync(base) : []) - .filter((d) => /^chromium-\d+$/.test(d)) - .sort((a, b) => +b.slice(9) - +a.slice(9)); - if (!builds.length) throw new Error('no Chromium in ~/.cache/ms-playwright — see README.md'); - return join(base, builds[0], 'chrome-linux/chrome'); -} - // ---------------------------------------------------------------- reference function loRender(file, work) {