The page workflows started one global webServer and ran with one worker. Each worker now owns its own tests/browser/server.py on an OS-chosen port, with its own temp root and database, through a shared `test` in tests/browser/fixtures.mjs. baseURL, and so page, request and browser.newContext, point at that worker's server. A server that dies fails the running test with its stderr tail and the next test gets a fresh one. The worker count comes from PM_TEST_WORKERS, else 1 under CI, else a quarter of the CPUs up to 8. Chromium workflows in the pinned image: 510 tests in 606 s with one worker on main, 511 (one new isolation spec) in 119 s with eight.
23 lines
1.1 KiB
JavaScript
23 lines
1.1 KiB
JavaScript
import { defineConfig, devices } from '@playwright/test';
|
|
import { workflowWorkers } from './test-workers.mjs';
|
|
|
|
// No global webServer: tests/browser/fixtures.mjs starts one server per worker
|
|
// on an OS-chosen port. Files run in parallel; tests inside a file keep their order.
|
|
export default defineConfig({
|
|
testDir: '../../tests/browser',
|
|
outputDir: './test-results/workflows',
|
|
testMatch: '*.spec.mjs',
|
|
workers: workflowWorkers(),
|
|
fullyParallel: false,
|
|
forbidOnly: Boolean(process.env.CI),
|
|
retries: 0,
|
|
reporter: 'list',
|
|
use: { trace: 'retain-on-failure', screenshot: 'only-on-failure' },
|
|
projects: [
|
|
{ name: 'chromium', outputDir: './test-results/workflows/chromium', use: { browserName: 'chromium' } },
|
|
{ name: 'firefox', outputDir: './test-results/workflows/firefox', use: { browserName: 'firefox' } },
|
|
{ name: 'webkit', outputDir: './test-results/workflows/webkit', use: { browserName: 'webkit' } },
|
|
{ name: 'touch', outputDir: './test-results/workflows/touch', use: { ...devices['Pixel 7'], browserName: 'chromium' } },
|
|
],
|
|
});
|