diff --git a/.github/workflows/e2e-nightly-full-matrix.yml b/.github/workflows/e2e-nightly-full-matrix.yml index f0fc000c..d2598485 100644 --- a/.github/workflows/e2e-nightly-full-matrix.yml +++ b/.github/workflows/e2e-nightly-full-matrix.yml @@ -25,8 +25,8 @@ jobs: strategy: fail-fast: false matrix: - shard: [1, 2, 3, 4, 5, 6, 7, 8] - shards: [8] + shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + shards: [12] steps: - name: Prepare writable home run: mkdir -p "$HOME" @@ -42,11 +42,15 @@ jobs: - name: Install run: npm ci + - name: Build docs for E2E + run: npm run docs:build + - name: E2E Tests env: PW_PROJECTS: firefox,webkit,msedge # Keep browser processes isolated; concurrent workers cause broad WebKit timing inflation. PW_WORKERS: '1' + PHASERFORGE_DOCS_PREBUILT: '1' run: npm run test:e2e -- --project=firefox --project=webkit --project=msedge --shard=${{ matrix.shard }}/${{ matrix.shards }} --fail-on-flaky-tests - name: Record timing telemetry diff --git a/tests/e2e/docs-list-markers.spec.ts b/tests/e2e/docs-list-markers.spec.ts index ff708d6c..8f4f11e1 100644 --- a/tests/e2e/docs-list-markers.spec.ts +++ b/tests/e2e/docs-list-markers.spec.ts @@ -59,7 +59,7 @@ async function ensureDocsBuild(): Promise { const donePath = pathMod.join(osMod.tmpdir(), `${runKey}.docs-build.done`); const staleMs = 60_000; - const hasBuiltDocs = () => fsMod.existsSync(donePath) && fsMod.existsSync(docsDistRoot); + const hasBuiltDocs = () => fsMod.existsSync(docsDistRoot) && (fsMod.existsSync(donePath) || process.env.PHASERFORGE_DOCS_PREBUILT === '1'); if (hasBuiltDocs()) return; diff --git a/tests/scripts/repair-harness-e2e-timing.test.ts b/tests/scripts/repair-harness-e2e-timing.test.ts index 9bbc3b1a..c3ccf6be 100644 --- a/tests/scripts/repair-harness-e2e-timing.test.ts +++ b/tests/scripts/repair-harness-e2e-timing.test.ts @@ -54,7 +54,20 @@ describe('repair harness E2E timing diagnostics', () => { }); it('runs the Full Matrix with one worker to prevent cross-browser WebKit contention', () => { - expect(readFileSync('.github/workflows/e2e-nightly-full-matrix.yml', 'utf8')).toContain("PW_WORKERS: '1'"); + const workflow = readFileSync('.github/workflows/e2e-nightly-full-matrix.yml', 'utf8'); + expect(workflow).toContain("PW_WORKERS: '1'"); + expect(workflow).toContain('shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]'); + expect(workflow).toContain('shards: [12]'); + }); + + it('builds docs before the Full Matrix and marks them prebuilt for the docs E2E', () => { + const workflow = readFileSync('.github/workflows/e2e-nightly-full-matrix.yml', 'utf8'); + const docsBuildIndex = workflow.indexOf('- name: Build docs for E2E'); + const e2eIndex = workflow.indexOf('- name: E2E Tests'); + + expect(docsBuildIndex).toBeGreaterThan(-1); + expect(docsBuildIndex).toBeLessThan(e2eIndex); + expect(workflow).toContain('PHASERFORGE_DOCS_PREBUILT: \'1\''); }); it('reproduces an isolated WebKit shard with one worker', () => {