Files
nexu-io__open-design/e2e/playwright.visual.config.ts
Marc Chan 9483329ecd ci: shard web tests and retain visual failure artifacts (#6416)
* ci: shard web tests and retain visual failure artifacts

Split the 6m web workspace job into two vitest shards and keep
Playwright trace/screenshot on visual failure for diagnosis.

* test(e2e): pin visual-pr-capture retain-on-failure path

Assert playwright_visual uploads keep e2e/ui/reports/visual-test-results
for both visual-pr-capture and visual-ci artifacts so report-consumed
diagnostics cannot silently regress.

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)

* test(e2e): pin web shards and baseline visual diagnostics

Lock the two-way web_workspace_tests vitest matrix in the CI topology
contract and upload retain-on-failure traces from visual-baseline.yml,
the second consumer of playwright.visual.config.ts.

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)
2026-08-05 11:48:10 +00:00

38 lines
1.2 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
import { initializePlaywrightRunNamespace } from './lib/playwright/runtime-identity.ts';
initializePlaywrightRunNamespace();
function parseWorkerCount(value: string | undefined): number {
if (value == null || value.length === 0) return 3;
const parsed = Number(value);
if (!Number.isInteger(parsed) || parsed < 1) {
throw new Error(`OD_PLAYWRIGHT_WORKERS must be a positive integer, got: ${value}`);
}
return parsed;
}
export default defineConfig({
testDir: './ui',
testMatch: 'visual-*.test.ts',
outputDir: './ui/reports/visual-test-results',
timeout: Number(process.env.OD_PLAYWRIGHT_TIMEOUT) || 240_000,
expect: {
timeout: 10_000,
},
retries: 0,
fullyParallel: process.env.OD_PLAYWRIGHT_FULLY_PARALLEL === '1',
workers: parseWorkerCount(process.env.OD_PLAYWRIGHT_WORKERS),
reporter: process.env.CI
? [['github'], ['list'], ['json', { outputFile: './ui/reports/visual-results.json' }]]
: [['list'], ['json', { outputFile: './ui/reports/visual-results.json' }]],
use: {
...devices['Desktop Chrome'],
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
viewport: { width: 1440, height: 900 },
deviceScaleFactor: 1,
},
});