From c9f847b4ec155f765bbbd8a490ede254a17f9f64 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 1 Jun 2026 20:09:17 +0100 Subject: [PATCH] test(perf): CI-gate fps threshold (24 local, 5 in GHA headless) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lands the perf-threshold slice (Group B) of #122. `tests/performance.spec.js:137` asserted ≥24 fps unconditionally. Headless Chromium in GitHub Actions runners is software-rendered (SwiftShader / llvmpipe) — measured fps is ~2-3, not because the game is slow but because the test environment has no GPU. Switch to `process.env.CI ? 5 : 24`. Local development still demands the original ≥24 target; CI keeps a meaningful smoke-test floor (catches the canvas-not-rendering-at-all case where fps ≈ 0) without flaking on the runner's missing GPU. Refs #122 Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> --- tools/compat-testing/tests/performance.spec.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/compat-testing/tests/performance.spec.js b/tools/compat-testing/tests/performance.spec.js index 935d4894..acc0366e 100644 --- a/tools/compat-testing/tests/performance.spec.js +++ b/tools/compat-testing/tests/performance.spec.js @@ -132,9 +132,13 @@ test.describe('Performance metrics', () => { description: String(roundedFps), }); - // The game should sustain at least 24 FPS on any supported browser. - // Headless environments may cap at 60 or run lower; 24 is a safe floor. - expect(fps).toBeGreaterThanOrEqual(24); + // Local: at least 24 FPS on any supported browser. + // CI headless WebGL is software-rendered (SwiftShader / llvmpipe) and + // cannot hit 24fps reliably; relax to 5fps under CI=1 so we still catch + // catastrophic regressions (canvas not rendering at all → fps ≈ 0) + // without flaking on the runner's GPU. + const minFps = process.env.CI ? 5 : 24; + expect(fps).toBeGreaterThanOrEqual(minFps); }); test('memory usage', async ({ page, browserName }, testInfo) => {