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
This commit is contained in:
Willem Jiang 2026-10-21 17:03:50 +08:00 committed by GitHub
parent d7a11c1581
commit d4012c4b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 3 deletions

View File

@ -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

View File

@ -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.