From ebdac3da13e54723f948d69ab8be6632ce60c4d0 Mon Sep 17 00:00:00 2001 From: Frederic Cabassut Date: Tue, 10 Mar 2026 07:46:14 +0100 Subject: [PATCH] perf: speed up e2e tests in CI - Pre-build before Playwright instead of building inside webServer - Reduce retries from 2 to 1 (fix flaky tests instead of masking them) - Set CI workers to 4 for more parallelism - Reduce artifact retention from 30 to 7 days Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 8 +++++++- playwright.config.ts | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c59bc72..10501f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,12 @@ jobs: if: steps.playwright-cache.outputs.cache-hit == 'true' run: npx playwright install-deps chromium + - name: Build + run: pnpm build + env: + DATABASE_URL: ./data/test-crumbs.db + NODE_ENV: test + - run: pnpm test:e2e env: CI: true @@ -91,7 +97,7 @@ jobs: path: | playwright-report/ test-results/ - retention-days: 30 + retention-days: 7 docker-build: name: Docker Build diff --git a/playwright.config.ts b/playwright.config.ts index 3c20dc6..d3ce3e8 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,7 +4,8 @@ export default defineConfig({ testDir: './tests/e2e', fullyParallel: true, forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, + retries: process.env.CI ? 1 : 0, + workers: process.env.CI ? 4 : undefined, reporter: 'html', globalSetup: './tests/e2e/global-setup.ts', use: { @@ -27,7 +28,7 @@ export default defineConfig({ } ], webServer: { - command: 'pnpm build && pnpm preview --port 4173', + command: 'pnpm preview --port 4173', port: 4173, reuseExistingServer: !process.env.CI, timeout: 120_000,