diff --git a/.github/workflows/lintBuildTest.yml b/.github/workflows/lintBuildTest.yml index 5d90fb8d2..d00c93fd2 100644 --- a/.github/workflows/lintBuildTest.yml +++ b/.github/workflows/lintBuildTest.yml @@ -55,7 +55,7 @@ jobs: - name: Build run: npm run build playwright: - name: Playwright (${{ matrix.browser }}) + name: Playwright (${{ matrix.browser }}, shard ${{ matrix.shard }}/3) timeout-minutes: 20 runs-on: macos-15-xlarge needs: install @@ -63,6 +63,7 @@ jobs: fail-fast: false matrix: browser: ['chrome', 'firefox', 'safari'] + shard: [1, 2, 3] steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 @@ -96,10 +97,53 @@ jobs: if: steps.playwright-cache.outputs.cache-hit == 'true' run: npx playwright install-deps - name: Run Playwright browser tests - run: npx playwright test --project=${{matrix.browser}} + run: npx playwright test --project=${{matrix.browser}} --shard=${{matrix.shard}}/3 - uses: actions/upload-artifact@v7 if: always() with: - name: test-results-${{ matrix.browser }} + name: test-results-${{ matrix.browser }}-shard-${{ matrix.shard }} path: test-results/ retention-days: 7 + # blob reports get merged into a single HTML report in playwright-result + - name: Upload blob report + uses: actions/upload-artifact@v7 + if: ${{ !cancelled() }} + with: + name: blob-report-${{ matrix.browser }}-${{ matrix.shard }} + path: blob-report/ + retention-days: 1 + # Merges shard reports and serves as the single status check for branch protection + playwright-result: + name: Playwright + if: always() + needs: playwright + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: 22 + cache: 'npm' + - run: npm ci + - name: Download blob reports + uses: actions/download-artifact@v8 + with: + path: all-blob-reports + pattern: blob-report-* + merge-multiple: true + - name: Merge into HTML report + run: npx playwright merge-reports --reporter html ./all-blob-reports + - name: Upload merged HTML report + uses: actions/upload-artifact@v7 + with: + name: playwright-report + path: playwright-report/ + retention-days: 7 + - name: Check shard results + run: | + if [ "${{ needs.playwright.result }}" = "success" ]; then + echo "All Playwright shards passed" + else + echo "Some Playwright shards failed: ${{ needs.playwright.result }}" + exit 1 + fi diff --git a/playwright.config.ts b/playwright.config.ts index 892b51613..d45e48782 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -27,7 +27,10 @@ export default { // Local runs also emit a compact plain-text failure report to .e2e-logs/ // (timestamped per run, last 10 kept) via test/e2e/compact-reporter.ts, so // an LLM agent can read the failures. - reporter: process.env.CI ? 'list' : [['list'], ['./test/e2e/compact-reporter.ts']], + // blob reports from sharded CI runs get merged into one HTML report in CI + reporter: process.env.CI + ? [['list'], ['blob']] + : [['list'], ['./test/e2e/compact-reporter.ts']], use: { trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure', baseURL: 'http://localhost:4009',