From d4012c4b24f9b5ee14236a8214c82815de5b5214 Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Wed, 21 Oct 2026 17:03:50 +0800 Subject: [PATCH] ci(e2e): split browser tests into four parallel shards (#7241) * ci(e2e): split browser tests into four parallel shards * docs: keep E2E guidance within the module size budget --- .github/workflows/e2e-tests.yml | 22 +++++++++++++++++++--- frontend/AGENTS.md | 2 ++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index baa4b0dcec..db0dbd099f 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -42,6 +42,10 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-latest timeout-minutes: 25 + strategy: + fail-fast: false + matrix: + shard: [1, 2, 3, 4] steps: - name: Checkout @@ -84,20 +88,32 @@ jobs: - name: Run E2E tests working-directory: frontend - run: pnpm exec playwright test + run: >- + pnpm exec playwright test + --shard=${{ matrix.shard }}/4 + --workers=1 + --reporter=github,html + --output=test-results/e2e env: SKIP_ENV_VALIDATION: '1' + PLAYWRIGHT_HTML_OUTPUT_DIR: playwright-report/e2e - name: Run auth recovery E2E tests + # Keep auth coverage unsharded and run it even if the first shard fails. + if: ${{ !cancelled() && matrix.shard == 1 }} working-directory: frontend - run: pnpm exec playwright test -c playwright.auth.config.ts + run: >- + pnpm exec playwright test -c playwright.auth.config.ts + --reporter=github,html + --output=test-results/auth env: SKIP_ENV_VALIDATION: '1' + PLAYWRIGHT_HTML_OUTPUT_DIR: playwright-report/auth - name: Upload Playwright report uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: - name: playwright-report + name: playwright-report-${{ matrix.shard }} path: frontend/playwright-report/ retention-days: 7 diff --git a/frontend/AGENTS.md b/frontend/AGENTS.md index de6d1b6ec3..bf1bc2d8ab 100644 --- a/frontend/AGENTS.md +++ b/frontend/AGENTS.md @@ -51,6 +51,8 @@ in node tests to cover those behaviors. E2E tests live under `tests/e2e/` and use Playwright with Chromium. They mock all backend APIs via `page.route()` network interception and test real page interactions (navigation, chat input, streaming responses). Config: `playwright.config.ts`. The real-backend auth contract in `tests/e2e-real-backend/auth-disabled-contract.spec.ts` and `backend/tests/test_auth_me_permissions.py` pin the complete route-permission list; update both when adding registered permissions (including `projects:read/write/delete`). +CI runs four E2E shards; only shard 1 runs auth recovery. Suite reports stay separate. + The dedicated `run-history.ts` hook replaces the unpaged runs hook. Show counts only after a successful history read, never during initial loading or errors. Scheduled run history uses task/page query keys and the existing live offset API.