| name | speed-up-test-suite |
| description | Reduce test-suite wall-clock (dev + CI) without losing coverage or telemetry. Measure the phase breakdown first, then apply proven levers (parallelize turbo, narrow imports vs barrels, lazy-load heavy graphs, pool/worker config, DB pool sizing) and capture the before/after delta. Use when tests are slow, CI time is high, or to set/check a perf baseline. Composes with the read-only test-perf and test-census skills. |
| metadata | {"short-description":"Playbook to cut test wall-clock via measured, proven levers"} |
speed-up-test-suite
Playbook for reducing test wall-clock (dev + CI). Companion to fix-test-flake. Use test-perf (timing/phase measurement) and test-census (test-type pyramid) as the read-only tools this skill acts on.
Golden rule: measure first
Run test-perf to get Vitest's phase breakdown (transform / setup / import / tests / environment), the slowest files, and CPU-vs-wall (parallelism headroom). Optimise the dominant cost, not a guess. Wall-clock is noisy on a shared/self-hosted machine - prefer the phase-summed metrics, which are change-attributable. Capture before/after for every change.
Proven levers (ranked by the impact this repo measured)
- Parallelize the unit suite: one
turbo run test with one --filter per package (DAG-parallel) instead of a per-package serial loop. ~3.3x (64s -> 18s).
- Parallelize structural lint invariants: run the independent
enforce-*.mjs scripts concurrently (collect exit codes), not &&-chained. ~3x.
- Cut per-file setup cost: under the setup module graph re-evaluates PER FILE across all test files. Import the NARROW seam, not the barrel (e.g. , not the whole barrel which drags in redis + msw + every fixture). ~48% of web setup.