From a905eb42acda7083bbfcd70a21780cd954f61070 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 5 Jul 2026 18:40:11 -0400 Subject: [PATCH] perf(test): skip fixture-only browser startup --- scripts/qa/ux-matrix-evidence-producer.ts | 24 +++++++++++++------ .../qa-ux-matrix-evidence-producer.test.ts | 12 ++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/scripts/qa/ux-matrix-evidence-producer.ts b/scripts/qa/ux-matrix-evidence-producer.ts index 7a1d744daf8c..50dbbeb0f60d 100644 --- a/scripts/qa/ux-matrix-evidence-producer.ts +++ b/scripts/qa/ux-matrix-evidence-producer.ts @@ -335,6 +335,16 @@ async function writePreflight(artifactBase: string) { ); } +async function writeSkippedVisualProof(logPath: string) { + const startedAt = Date.now(); + await writeText(logPath, "blocked: --skip-visual-proof was set\n"); + return { + failureReason: "--skip-visual-proof was set", + status: "blocked" as const, + wallMs: Date.now() - startedAt, + }; +} + function isMissingManagedPlaywrightBrowser(error: unknown) { const message = error instanceof Error ? error.message : String(error); return ( @@ -389,7 +399,11 @@ async function captureControlUiScreenshot(params: { logPath: string; repoRoot: string; screenshotPath: string; + skipVisualProof: boolean; }) { + if (params.skipVisualProof) { + return writeSkippedVisualProof(params.logPath); + } const startedAt = Date.now(); try { const { browser } = await launchUxMatrixChromium(); @@ -519,15 +533,10 @@ async function captureProducerArtifactFixtureProof(params: { skipVisualProof: boolean; videoPath: string; }) { - const startedAt = Date.now(); if (params.skipVisualProof) { - await writeText(params.logPath, "blocked: --skip-visual-proof was set\n"); - return { - failureReason: "--skip-visual-proof was set", - status: "blocked" as const, - wallMs: Date.now() - startedAt, - }; + return writeSkippedVisualProof(params.logPath); } + const startedAt = Date.now(); try { const videoDir = path.join(path.dirname(params.videoPath), "recording"); await fs.mkdir(videoDir, { recursive: true }); @@ -671,6 +680,7 @@ export async function runUxMatrixEvidenceProducer(options: ProducerOptions) { logPath: path.join(screenshotCellDir, "logs.txt"), repoRoot: options.repoRoot, screenshotPath: matrixScreenshotPath, + skipVisualProof: options.skipVisualProof, }); const initialCells: MatrixCell[] = [ diff --git a/test/scripts/qa-ux-matrix-evidence-producer.test.ts b/test/scripts/qa-ux-matrix-evidence-producer.test.ts index ffbedfc17e5b..f770870ff17e 100644 --- a/test/scripts/qa-ux-matrix-evidence-producer.test.ts +++ b/test/scripts/qa-ux-matrix-evidence-producer.test.ts @@ -124,9 +124,21 @@ describe("QA UX Matrix evidence producer CLI", () => { path.join(artifactBase, "surfaces", "cli", "stages", "entrypoint-help", "logs.txt"), "utf8", ); + const visualLog = fs.readFileSync( + path.join( + artifactBase, + "surfaces", + "control-ui", + "stages", + "screenshot-artifact", + "logs.txt", + ), + "utf8", + ); expect(evidence).not.toContain(fakeRepoRoot); expect(cliLog).not.toContain(fakeRepoRoot); expect(`${evidence}\n${cliLog}`).toContain(""); + expect(visualLog).toBe("blocked: --skip-visual-proof was set\n"); } finally { fs.rmSync(artifactBase, { recursive: true, force: true }); fs.rmSync(fakeRepoRoot, { recursive: true, force: true });