diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9087a5cd..86a9925e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,6 +177,10 @@ jobs: # The performance spec runs in its own job so neither group nears Playwright's # 12-minute global timeout; one worker keeps its timings uncontended. + # + # Every project here drives the runner's own Google Chrome (`channel: + # "chrome"`), so no job installs a browser. The specs that need Playwright's + # Chromium run in its pinned image below. e2e: name: Browser ${{ matrix.group }} runs-on: ubuntu-24.04 @@ -187,7 +191,7 @@ jobs: include: # The suite runs on one worker, and most of its time is the 1100 # viewport's accessibility and smoke specs, so each 1100 scheme gets a - # runner and the 1440 viewport shares one with the short MCP specs. + # runner and the 1440 viewport's two schemes share one. - group: smoke and accessibility (1100 light) slug: smoke-1100-light skip_performance: "1" @@ -196,20 +200,14 @@ jobs: slug: smoke-1100-dark skip_performance: "1" args: --project=app-1100-dark - - group: smoke and accessibility (1440, MCP) - slug: smoke-1440-mcp + - group: smoke and accessibility (1440) + slug: smoke-1440 skip_performance: "1" - args: --project=app-1440-light --project=app-1440-dark --project=mcp + args: --project=app-1440-light --project=app-1440-dark - group: performance slug: performance skip_performance: "" args: e2e/specs/app/performance.spec.ts - # The local Storybook catalog runs in its own job so the smoke group - # stays inside its timeout; `just check` stays browser-free. - - group: catalog - slug: catalog - skip_performance: "1" - args: "" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0 @@ -226,14 +224,7 @@ jobs: node-version: 24.19.0 - name: just ui-deps run: just ui-deps - - name: just e2e-browsers - if: startsWith(matrix.slug, 'smoke') || matrix.slug == 'catalog' - run: just e2e-browsers - - name: just design-check - if: matrix.slug == 'catalog' - run: just design-check - name: just e2e - if: matrix.slug != 'catalog' run: just e2e ${{ matrix.args }} env: PITOT_E2E_SKIP_PERFORMANCE: ${{ matrix.skip_performance }} @@ -248,8 +239,10 @@ jobs: if-no-files-found: ignore retention-days: 7 + # The pinned Playwright image already holds Chromium and its OS libraries, so + # these jobs skip the browser download and the package installs behind it. visual: - name: Browser visual + name: Browser visual and MCP runs-on: ubuntu-24.04 timeout-minutes: 10 container: @@ -264,8 +257,11 @@ jobs: run: cd ui/host && bun install --frozen-lockfile - name: Check image driver version run: node scripts/playwright-image-check.mjs - - name: Visual comparisons - run: cd ui/host && bun run e2e --project visual + # One run, so a failure in either project keeps its evidence: a second + # run would clear the first one's report and results. The MCP specs are + # recorded protocol and accessibility checks; neither needs a Go server. + - name: Visual comparisons and MCP specs + run: cd ui/host && bun run e2e --project visual --project mcp - name: Upload browser evidence and Linux baselines if: always() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 @@ -278,6 +274,36 @@ jobs: if-no-files-found: ignore retention-days: 7 + # The local Storybook catalog; `just check` stays browser-free. + catalog: + name: Browser catalog + runs-on: ubuntu-24.04 + timeout-minutes: 15 + container: + image: mcr.microsoft.com/playwright:v1.65.1-noble@sha256:1507cbfc550a63a6b7396791ca4f00df17beb56342d2447b3f106c306f525579 + options: --ipc=host + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + # The browser image lacks unzip, which setup-bun needs. + - name: Install Bun + run: npm install --global bun@1.4.2 + - name: Install UI dependencies + run: cd ui/host && bun install --frozen-lockfile + - name: Check image driver version + run: node scripts/playwright-image-check.mjs + - name: Catalog checks + run: cd ui/host && bun run design-check + - name: Upload browser evidence + if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: browser-evidence-catalog + path: | + ui/host/playwright-report/ + ui/host/test-results/ + if-no-files-found: ignore + retention-days: 7 + # Build the exact runtime image on pull requests and in the merge queue, and # reject high/critical OS, Go-binary, or embedded-secret findings before # merge. It runs beside Gate rather than after it; both are required. diff --git a/docs/testing.md b/docs/testing.md index f4b3c64b..c05fb506 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -2,9 +2,9 @@ Install Go, Bun, just and Google Chrome, then run `just ui-deps` and `just e2e-browsers`. The latter invokes the locked Playwright CLI to install its -bundled Chromium and required Linux OS libraries; CI smoke uses the same recipe -before running MCP tests on a clean Ubuntu runner. Linux may request sudo for OS -packages. From `ui/host`, run `bun run e2e --help` for the pinned Playwright CLI. +bundled Chromium and required Linux OS libraries. CI does not run it: the MCP +specs and the catalog use the pinned Playwright image, which already holds both. +Linux may request sudo for OS packages. From `ui/host`, run `bun run e2e --help` for the pinned Playwright CLI. The app matrix uses system Google Chrome. No AI provider key is needed. Run `just e2e` from the repository root to rebuild the embedded SPA, MCP App and `bin/pitot`, then run every surface. `just check` remains browser-free. @@ -341,7 +341,7 @@ and 1024×768 using the toolbar. schemes at both widths. Install the locked browser with `just e2e-browsers` first. Accessibility errors, clipped or overlapping text, horizontal page overflow, covered scrollbars, and unexpected API requests fail the check. -- CI runs the catalog in the browser smoke job, after installing Chromium; +- CI runs the catalog in its own job, in the pinned Playwright image; `just check` stays browser-free. The check uses one worker, no file parallelism, and a 60-second story timeout to remain runnable on shared machines.