Skip to content

Frontend tests run as vitest and Playwright parts on separate runners, the budget specs after one warm-up boot - #288

Merged
zlareb1 merged 11 commits into
mainfrom
ci/frontend-parallel
Nov 6, 2026
Merged

zlareb1 merged 11 commits into
mainfrom
ci/frontend-parallel

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

...

Why

frontend tests (vitest + axe + playwright) was the third-longest job on main: 21.5, 21.6, 27.0 and 29.1 minutes in four recent runs, the last one minute under its 30-minute timeout. One runner ran vitest (7.5 minutes for 216 files) and then Playwright (13.5 minutes for 497 tests on one worker). The two suites share nothing but npm ci.

The job is now two jobs, frontend-vitest and frontend-e2e (Playwright), with five parts between them, each on its own runner:

  • vitest parts 1 and 2 (--shard=k/2), which split the test files;
  • Playwright parts 1 to 3 (--shard=k/3). With fullyParallel: false a part holds whole spec files per project (explorer-*.spec.ts runs in two projects, which may land in different parts).

Each part passes --shard=${{ matrix.part }}/${{ strategy.job-total }}, so the part count comes from the matrix itself and no part can run a different split from its siblings.

Playwright keeps workers: 1 inside each part. perf-budget.spec.ts and route-budget.spec.ts measure long tasks and LCP at 4x CPU throttling, and a second worker on the same runner would compete for the CPU those budgets assume. Running the parts on separate runners shortens the job without changing what each budget measures.

Playwright part k uploads its screenshots and traces as frontend-e2e-k.

The budget specs boot the app once, unmeasured, before their first budget (warmUp in frontend/e2e/fixtures.ts, a beforeAll in perf-budget.spec.ts and route-budget.spec.ts). In one job they ran after a few hundred other tests. In a part of their own they can run first on a fresh runner, where the first page also pays for reading Chromium, the fonts and the preview server's files from a cold disk. Without the warm-up, perf-budget failed or flaked in three of four runs of part 3: its boot LCP at 1,624 and 2,500 ms against 1,500, and its 100-row long tasks at 2,674 ms against 2,500. In the last 25 runs on main it never did. With the warm-up, part 3 passed with no retry in four of four runs at 0f2dbfc (run 42235989314 and three reruns of its part 3). route-budget.spec.ts gets the same warm-up by the same reasoning: it measures LCP and long tasks at 4x CPU too, though no run of it failed. The budgets themselves are unchanged.

Scope and risk

CI configuration, the testing docs' job rows, the CI skill's rows, the comment in playwright.config.ts, and the two budget specs' warm-up (frontend/e2e/fixtures.ts, perf-budget.spec.ts, route-budget.spec.ts). No application code changes. The warm-up runs in its own page and context, unthrottled and unmeasured, and every budget test still gets a fresh context, so each budget measures what it did; none is loosened. The parts together run the same files as the single job did. vitest and Playwright both refuse a --shard index past the count (checked: vitest run --shard=3/2 and playwright test --shard=4/3 both exit with an error).

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none. No required status check names the old job.
  • Rollback: revert.

Tests

Measured on this PR's CI run at 78ba2c1. Commits after it rename the vitest job's id (to frontend-vitest; its check name is unchanged), switch npx vitest run / npx playwright test to the package scripts that run the same commands, lower the Playwright timeout, update the docs' and skill's rows, and add the budget specs' warm-up below:

part job
vitest 1 4:20
vitest 2 3:40
Playwright 1 6:07
Playwright 2 5:37
Playwright 3 7:00

The longest part sets the wall clock at 7.0 minutes, down from 21.5 to 29.1. playwright test --shard=k/3 --list puts 188, 155 and 160 tests in the three parts: 503 listed, of which the 6 in docs-screenshots.spec.ts skip unless LOOM_DOCS_SCREENSHOTS=1, so 497 run. a11y (132 s on main's run) and focus-rings (119 s) are in part 1, and perf-budget (139 s) and route-budget (45 s) are in part 3.

pytest tests/unit/test_doc_links.py tests/unit/test_public_copy.py tests/unit/test_agent_instructions.py passes, and so do the unit tests that read ci.yml.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. The author checked the per-spec durations and the shard semantics.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships bumps both plugin manifests' version.
  • The frontend builds and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
  • Commits are signed off (git commit -s).

🤖 Generated with Claude Code

zlareb1 and others added 8 commits November 6, 2026 13:20
…, one runner each

One runner took 21 minutes for vitest and Playwright in sequence. Each Playwright part keeps one worker, so the CPU budgets are still measured on an idle machine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…row per suite

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…m the matrix

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…y of the worker reason, a 20-minute part timeout

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…ves its cause, no part counts outside the matrix

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…artial list of specs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…dget

In a part of its own a budget spec can run first on a fresh runner, where the first page also pays for a cold browser and disk: perf-budget failed its LCP budget at 1,624 and 2,500 ms there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1 zlareb1 changed the title The frontend tests run as two vitest parts and three Playwright parts, one runner each Frontend tests run as vitest and Playwright parts, one runner each Nov 6, 2026
@zlareb1 zlareb1 changed the title Frontend tests run as vitest and Playwright parts, one runner each Frontend tests run as vitest and Playwright parts on separate runners, the budget specs after one warm-up boot Nov 6, 2026
zlareb1 and others added 3 commits November 6, 2026 15:31
… hook after the file's header

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…fect, the vitest config names the e2e specs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 89450f2 into main Nov 6, 2026
27 of 28 checks passed
@zlareb1
zlareb1 deleted the ci/frontend-parallel branch November 6, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant