-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
92 lines (91 loc) · 3.11 KB
/
playwright.config.ts
File metadata and controls
92 lines (91 loc) · 3.11 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
85
86
87
88
89
90
91
92
import { defineConfig, devices } from "@playwright/test";
/**
* Playwright configuration for DataLab-Web end-to-end tests.
*
* The first page load downloads Pyodide (~10 MB) and installs Sigima via
* micropip, so the CI-friendly defaults below give the boot sequence a
* generous timeout. The Vite dev server is reused locally and started
* fresh in CI.
*
* Two projects are defined:
*
* * ``chromium`` (default) — the regression suite. Excludes
* performance benchmarks and ``_repro_*`` throwaway probes.
* * ``perf`` (opt-in) — performance-only specs (``image_perf``,
* and any ``PERF``-gated tests). Run with
* ``npx playwright test --project=perf``.
*/
export default defineConfig({
testDir: "./tests/e2e",
timeout: 240_000,
expect: { timeout: 30_000 },
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: process.env.CI
? [["github"], ["html", { open: "never" }]]
: [["list"]],
use: {
baseURL: "http://localhost:5173",
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
// The image-display benchmark is a perf probe, not a regression
// invariant; it lives under the ``perf`` project to keep the
// default CI run cheap. ``_repro_*`` throwaway specs are also
// excluded so a forgotten reproduction probe never lands in CI.
testIgnore: [
/image_perf\.spec\.ts/,
/_repro_.*\.spec\.ts/,
/tests[\\/]benchmark[\\/]/,
],
},
{
name: "perf",
use: { ...devices["Desktop Chrome"] },
testMatch: [/image_perf\.spec\.ts/],
timeout: 600_000,
},
{
// Comparative benchmark suite (DataLab Web vs DataLab Qt). Opt-in
// only — these specs run for tens of minutes and produce JSON
// result files under ``tests/benchmark/results/``. Run with
// ``npx playwright test --project=benchmark`` or via
// ``npm run bench:run`` (orchestrator script).
name: "benchmark",
// Headless Chromium with explicit flags to defeat background-tab
// throttling. By default a non-focused window (or any headless
// window) gets throttled timers and de-prioritised V8 JIT, which
// inflates Pyodide-Browser timings ×2 vs CPython. Disabling the
// throttling brings the ratio down to ~×1.25 (in line with
// Pyodide-Node) and is reproducible regardless of focus.
use: {
...devices["Desktop Chrome"],
launchOptions: {
args: [
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--disable-features=CalculateNativeWinOcclusion",
],
},
},
testDir: "./tests/benchmark",
timeout: 120 * 60_000,
},
],
webServer: {
command: "npm run dev",
url: "http://localhost:5173",
reuseExistingServer: !process.env.CI,
timeout: 60_000,
stdout: "ignore",
stderr: "pipe",
},
});