Golden paths
Make CI faster
Variance Authority keeps that record on the suite you already run. This page orders the steps and links the page that owns each one; read a step's page when you reach it.
1. Split the suite across CI jobs by time
--shard k/n normally deals out test files by count, so one shard gets the slow
ones and the run waits for it. Wrap the Vitest, Jest or Playwright config with
withTestSelection and each shard takes whole files by how long they took on
the last recorded run, so the shards finish close together. No test is skipped
yet: this step only removes the wait for the slowest shard.
The wrap is also what records: every wrapped run writes the record, and your mainline publishes its shards' records to the share that every later run reads.
Split a suite across CI jobs, and the share for where main's record is kept.
2. Run only the tests a change reached
A pull request then reads the record main saved and leaves out every test file that ran none of the changed code. The selection reads which lines each test covered, not which files import which, so a one-line edit to a shared module runs the few tests that executed the changed code. When the record leaves a doubt, the run either widens or stops, and says which doubt it was.
Coverage-based test selection says why this selects less than an import graph. How test selection works sets it up in CI, and What a skipped test promises says exactly when a test is left out.
3. Let the next push run only what it changed
Each push to a pull request lands on a fresh CI machine, so measured from main's
record it reruns the whole change, and a one-line fix costs as much as the push
before it. Run variance carry keep after the tests, red or green, and the
pull request's cache saves the record that push wrote. Run variance carry take
before the tests on the next push, and it lays that record over main's, so the
push runs what changed since the last one and every test file that one did not
finish green.
4. Give the edit loop the same answer
The same selection runs on your machine, after every edit, with no script of
ours in between: put VARIANCE_AUTHORITY_SINCE= in front of the runner you
already call. Add VARIANCE_AUTHORITY_AT_DISTANCE=0-1 to keep the tests within
one import of the change, and you or your coding agent read a verdict in about a
second, while the edit is still fresh. Before you hand the change over, the
same page says how to run the tests further from it.
Run the tests an edit needs and its loop an agent runs after each edit. Measure test distance says how the order is counted.
What it measured on real suites
Measured in test file runs, selection ran 57% fewer on Zod, a package whose tests nearly all reach its code through one barrel, and 78% fewer than Nx on TanStack Query, a 27-package monorepo.