Files
Stephen Brown IIandGitHub d36e564e6c [AI] CI: Support parallel e2e shards locally with per-shard port (#8456)
* [AI] ci: support parallel e2e shards with per-shard port

- Add 'Set E2E port' step to functional and vrt jobs (E2E_PORT = 3000 + shard)
- Use vars.E2E_SHARD_TOTAL (with fallback '3') for shard denominator in job
  names and test commands; pass --var E2E_SHARD_TOTAL=1 to run full suite in
  a single local shard without relaunching
- Add .actrc with depot runner image mappings

* [AI] fix(ci): address review feedback on e2e shard guard/injection
2026-07-21 19:00:18 +00:00

54 lines
2.0 KiB
TypeScript

import path from 'node:path';
import { defineConfig } from '@playwright/test';
const e2ePort = Number(process.env.E2E_PORT) || 3001;
export default defineConfig({
timeout: 60000, // 60 seconds
retries: 1,
fullyParallel: true,
workers: Number(process.env.E2E_WORKERS) || (process.env.CI ? 4 : undefined),
testDir: 'e2e/',
reporter: process.env.CI
? [['blob'], ['list'], ['junit', { outputFile: 'test-results/junit.xml' }]]
: [['html', { open: 'never' }]],
use: {
userAgent: 'playwright',
screenshot: 'only-on-failure',
browserName: 'chromium',
baseURL: process.env.E2E_START_URL ?? `http://localhost:${e2ePort}`,
trace: 'on-first-retry',
ignoreHTTPSErrors: true,
},
expect: {
// Default expect timeout (5s) is too tight for initial render of the
// budget page in the production bundle under CI CPU contention —
// the budget-table testid lives inside AutoSizer, which returns null
// until layout provides width/height, and that can take >5s. Bumping
// to 10s lets those assertions settle without per-test overrides.
timeout: 10_000,
// `threshold` is pixelmatch's per-pixel YIQ-delta cutoff — a pixel
// counts toward `maxDiffPixels` only if its delta exceeds
// 35215 * threshold². Playwright's 0.2 default lets faint color
// overlays (e.g. rgba(…, .15) row striping) slip through with 0
// reported diff pixels; 0.05 catches them while staying above
// anti-aliasing noise.
toHaveScreenshot: { maxDiffPixels: 5, threshold: 0.05 },
},
webServer: process.env.E2E_START_URL
? undefined
: {
cwd: path.join(__dirname, '..', '..'),
command: process.env.E2E_USE_BUILD
? `PORT=${e2ePort} node packages/desktop-client/bin/serve-build.mjs`
: 'yarn start',
url: `http://localhost:${e2ePort}`,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',
stderr: 'pipe',
ignoreHTTPSErrors: true,
timeout: 120_000,
},
});