|
13 | 13 | * shared runner: no emulation, but the constrained budgets, because a hosted |
14 | 14 | * runner is already slower and noisier than the machine the strict numbers were |
15 | 15 | * recorded on. Throttling it further would measure the throttle, not the build. |
| 16 | + * CI also requires production React and reports the observed runtime so Vite's |
| 17 | + * development-only checks can never contaminate the shipped-code measurement. |
16 | 18 | * |
17 | 19 | * TIMELINE_ROW_VIRTUALIZATION selects which build is under test and defaults to |
18 | 20 | * "on", the product default. The script asserts the configuration it observes |
@@ -284,6 +286,14 @@ try { |
284 | 286 | ); |
285 | 287 | await waitForStudioTestHookSettle(page); |
286 | 288 |
|
| 289 | + const runtimeMode = await page.evaluate(() => window.__studioTest.runtimeMode); |
| 290 | + if (TIER === "ci" && runtimeMode !== "production") { |
| 291 | + throw new Error( |
| 292 | + `Timeline CI must measure the production React runtime, received ${runtimeMode}. ` + |
| 293 | + "Start the Studio development server with NODE_ENV=production.", |
| 294 | + ); |
| 295 | + } |
| 296 | + |
287 | 297 | await loadFixtureAndWait(page, 1_000, PROFILE); |
288 | 298 | await client.send("HeapProfiler.collectGarbage"); |
289 | 299 | const baselineHeapBytes = await collectHeapBytes(client); |
@@ -374,6 +384,7 @@ try { |
374 | 384 | deviceScaleFactor: TIER === "high-dpr" ? 2 : 1, |
375 | 385 | cpuThrottleRate: TIER === "low-resource" ? 4 : 1, |
376 | 386 | tier: TIER, |
| 387 | + runtimeMode, |
377 | 388 | longTaskObserverProbe, |
378 | 389 | rowVirtualization: ROW_VIRTUALIZATION, |
379 | 390 | observedClipRootsAtLoad: observedClipRoots, |
|
0 commit comments