-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
84 lines (82 loc) · 3.44 KB
/
Copy pathplaywright.config.ts
File metadata and controls
84 lines (82 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { defineConfig, devices } from '@playwright/test';
/**
* The WebGL fidelity gate spec. The `chromium-fidelity` project runs ONLY this
* file; the normal `chromium`/`firefox`/`webkit` projects run everything EXCEPT
* it. A glob (not a path) so it matches regardless of the project's working dir.
*/
const FIDELITY_SPEC = '**/webgl-fidelity-gate.spec.ts';
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: 'html',
use: {
baseURL: 'http://localhost:5173',
trace: 'on-first-retry',
},
projects: [
// ── Normal e2e matrix ────────────────────────────────────────────────────
// These run the WHOLE suite EXCEPT the WebGL fidelity gate, which is GPU-
// dependent and lives in its own dedicated project/CI job below. We ignore it
// here so the normal matrix never tries to run it (it is also internally
// `RUN_FIDELITY`-gated via `test.skip`, so this is belt-and-suspenders).
{
name: 'chromium',
testIgnore: FIDELITY_SPEC,
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
testIgnore: FIDELITY_SPEC,
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
testIgnore: FIDELITY_SPEC,
use: { ...devices['Desktop Safari'] },
},
// ── WebGL fidelity gate (ADR 0019, Stage 3) ──────────────────────────────
// Headless Chromium with ANGLE + SwiftShader so a software WebGL2 context is
// available on GPU-less CI runners. This project is targeted explicitly by
// the `test-e2e-fidelity` CI job (RUN_FIDELITY=1) and is NOT part of the
// normal e2e matrix above. It runs ONLY the fidelity spec (via `testMatch`)
// so the gate is fast and unambiguous under the SwiftShader flags — it does
// not drag the whole 200+ test suite through software GL. The load-bearing
// flags are `--use-gl=angle --use-angle=swiftshader --enable-unsafe-swiftshader
// --ignore-gpu-blocklist`; the rest force WebGL on regardless of blocklists.
{
name: 'chromium-fidelity',
testMatch: FIDELITY_SPEC,
// A fidelity mismatch is DETERMINISTIC under the fixed synthetic dataset +
// software SwiftShader — retrying cannot change the pixels, it only burns
// another full (slow) run per view. We pin retries to 0 here (overriding the
// matrix-wide `retries: 2` above) so a failing gate fails ONCE and fast,
// instead of the 3× heavy re-runs that helped push the job past 25 min.
retries: 0,
// Per-test cap as a backstop to the in-spec `test.setTimeout(40_000)`; with
// the slimmed lane-band/column-strided reads, a view completes well inside it.
timeout: 60_000,
use: {
...devices['Desktop Chrome'],
deviceScaleFactor: 2,
launchOptions: {
args: [
'--use-gl=angle',
'--use-angle=swiftshader',
'--enable-unsafe-swiftshader',
'--ignore-gpu-blocklist',
'--enable-webgl',
'--enable-features=Vulkan',
],
},
},
},
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:5173',
reuseExistingServer: !process.env.CI,
},
});