fix(e2e): route pcbnew-family specs to bundled Chromium on CI

The xvfb/WebGL fix (f37ddc4) took CI from 22 to 11 failures (identical on
Hetzner 27343415331 and Ubicloud 27343416511) — everything left is the
pcbnew family, still dying at wasm compile: pcbnew's ~190M debug module
exceeds SpiderMonkey's per-process code budget on x86-64 even with the
baseline-only JIT (the same module compiles on arm64, whose denser code
fits — which is why the local arm64 repro passed). No pref raises that
limit; V8 handles the module fine.

New CI-only 'chromium-ci' project (bundled Chromium, headless, SwiftShader
via --enable-unsafe-swiftshader) carries pcbnew/pcbnew-collab/load-pcb/
load-pcb-probe; the firefox project ignores them on CI. Workflows call the
new test:kicad:ci script which runs both projects. Local test:kicad is
unchanged (firefox everywhere, system Chrome for headed runs).

Validated under x86 emulation (linux/amd64 playwright image on Rosetta):
the pcbnew wizard test passes on chromium-ci in 23s against the fresh
v130-postprocessed 192M module.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Istvan Matejcsok 2026-06-11 16:12:01 +02:00
commit e913bebdeb
4 changed files with 40 additions and 4 deletions

View file

@ -108,11 +108,13 @@ jobs:
working-directory: tests working-directory: tests
run: npm run setup:kicad run: npm run setup:kicad
- name: KiCad e2e (npm run test:kicad) - name: KiCad e2e (npm run test:kicad:ci)
working-directory: tests working-directory: tests
# xvfb-run: headed Firefox on a virtual display — WebGL needs GLX + Mesa # xvfb-run: headed Firefox on a virtual display — WebGL needs GLX + Mesa
# llvmpipe, which headless Firefox can't reach on a GPU-less VM. # llvmpipe, which headless Firefox can't reach on a GPU-less VM.
run: xvfb-run -a npm run test:kicad # test:kicad:ci adds the chromium-ci project: pcbnew's wasm exceeds
# SpiderMonkey's x86-64 code budget, so those specs run on Chromium.
run: xvfb-run -a npm run test:kicad:ci
- name: Upload test logs & screenshots - name: Upload test logs & screenshots
if: always() if: always()

View file

@ -154,11 +154,13 @@ jobs:
working-directory: tests working-directory: tests
run: npm run test run: npm run test
- name: KiCad e2e (npm run test:kicad) - name: KiCad e2e (npm run test:kicad:ci)
working-directory: tests working-directory: tests
# xvfb-run: headed Firefox on a virtual display — WebGL needs GLX + Mesa # xvfb-run: headed Firefox on a virtual display — WebGL needs GLX + Mesa
# llvmpipe, which headless Firefox can't reach on a GPU-less VM. # llvmpipe, which headless Firefox can't reach on a GPU-less VM.
run: xvfb-run -a npm run test:kicad # test:kicad:ci adds the chromium-ci project: pcbnew's wasm exceeds
# SpiderMonkey's x86-64 code budget, so those specs run on Chromium.
run: xvfb-run -a npm run test:kicad:ci
# 6) Always capture logs/screenshots for post-mortem. # 6) Always capture logs/screenshots for post-mortem.
- name: Upload test logs & results - name: Upload test logs & results

View file

@ -15,6 +15,7 @@
"test:kicad:firefox": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=firefox", "test:kicad:firefox": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=firefox",
"test:kicad:chrome": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=chromium --headed", "test:kicad:chrome": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=chromium --headed",
"test:kicad": "npm run test:kicad:firefox", "test:kicad": "npm run test:kicad:firefox",
"test:kicad:ci": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=firefox --project=chromium-ci",
"test:kicad:headed": "npm run test:kicad:chrome", "test:kicad:headed": "npm run test:kicad:chrome",
"test:pcbnew:firefox": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=firefox kicad/pcbnew.spec.ts", "test:pcbnew:firefox": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=firefox kicad/pcbnew.spec.ts",
"test:pcbnew:chrome": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=chromium --headed kicad/pcbnew.spec.ts", "test:pcbnew:chrome": "npm run setup:kicad && playwright test --config=playwright-kicad.config.ts --project=chromium --headed kicad/pcbnew.spec.ts",

View file

@ -62,6 +62,18 @@ function findFreePort(): number {
const port = resolvePort(); const port = resolvePort();
// pcbnew's wasm (~190M debug build) exceeds SpiderMonkey's per-process code
// budget on x86-64 CI even with the baseline-only JIT (run 27343416511:
// "InternalError: out of memory" at instantiation; the same module compiles
// on arm64, whose denser code fits). V8 handles it, so on CI these specs run
// on bundled Chromium (the 'chromium-ci' project) and firefox skips them.
const PCBNEW_FAMILY_SPECS = [
'**/pcbnew.spec.ts',
'**/pcbnew-collab.spec.ts',
'**/load-pcb.spec.ts',
'**/load-pcb-probe.spec.ts',
];
export default defineConfig({ export default defineConfig({
globalSetup: './global-setup.ts', globalSetup: './global-setup.ts',
testDir: './kicad', testDir: './kicad',
@ -85,6 +97,9 @@ export default defineConfig({
{ {
// Firefox is the default for headless testing (works on ARM Mac) // Firefox is the default for headless testing (works on ARM Mac)
name: 'firefox', name: 'firefox',
// On CI the pcbnew-family specs run on chromium-ci instead (see
// PCBNEW_FAMILY_SPECS above for why).
...(process.env.CI ? { testIgnore: PCBNEW_FAMILY_SPECS } : {}),
use: { use: {
...devices['Desktop Firefox'], ...devices['Desktop Firefox'],
viewport: { width: 1280, height: 720 }, viewport: { width: 1280, height: 720 },
@ -124,6 +139,22 @@ export default defineConfig({
viewport: { width: 1280, height: 720 }, viewport: { width: 1280, height: 720 },
}, },
}, },
{
// CI-only carrier for the pcbnew-family specs (see PCBNEW_FAMILY_SPECS):
// Playwright-bundled Chromium, headless, software WebGL via SwiftShader
// (fine on x86 Linux; the SwiftShader bug above is ARM-Mac-specific).
// --enable-unsafe-swiftshader: newer Chromium refuses software WebGL in
// headless without it.
name: 'chromium-ci',
testMatch: PCBNEW_FAMILY_SPECS,
use: {
...devices['Desktop Chrome'],
viewport: { width: 1280, height: 720 },
launchOptions: {
args: ['--enable-unsafe-swiftshader'],
},
},
},
], ],
webServer: { webServer: {