Repository navigation
Frontend tests run as vitest and Playwright parts on separate runners, the budget specs after one warm-up boot - #288
Merged
Merged
Conversation
…, 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]>
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]>
9 tasks done
… hook after the file's header Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
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 onmain: 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 butnpm ci.The job is now two jobs,
frontend-vitestandfrontend-e2e(Playwright), with five parts between them, each on its own runner:--shard=k/2), which split the test files;--shard=k/3). WithfullyParallel: falsea part holds whole spec files per project (explorer-*.spec.tsruns 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: 1inside each part.perf-budget.spec.tsandroute-budget.spec.tsmeasure 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 (
warmUpinfrontend/e2e/fixtures.ts, abeforeAllinperf-budget.spec.tsandroute-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-budgetfailed 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 onmainit 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.tsgets 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--shardindex past the count (checked:vitest run --shard=3/2andplaywright test --shard=4/3both exit with an error).Compatibility, rollout and rollback
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), switchnpx vitest run/npx playwright testto 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:The longest part sets the wall clock at 7.0 minutes, down from 21.5 to 29.1.
playwright test --shard=k/3 --listputs 188, 155 and 160 tests in the three parts: 503 listed, of which the 6 indocs-screenshots.spec.tsskip unlessLOOM_DOCS_SCREENSHOTS=1, so 497 run.a11y(132 s onmain's run) andfocus-rings(119 s) are in part 1, andperf-budget(139 s) androute-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.pypasses, and so do the unit tests that readci.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 typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.main; no merged migration is edited.frontend/changed.docs/describe the system as it now is.git commit -s).🤖 Generated with Claude Code