Bellwether

Free on public repositories

Test selection

On every pull request, Bellwether walks the diff against a recorded map and runs only the tests that can reach a changed file. Median suites drop to 13 percent of their size.

Median selection
13% of a 2,000–10,000 test suite
Overhead per run
About 25 seconds
Map refresh
Every full run, including the nightly one
Languages
Ruby, Python, JS/TS, Go, Java, Rust
Hands typing on a dark laptop keyboard in a dim room
$ bellwether select --base main
diff      3 files changed
selected  412 of 3,108 tests
skipped   2,696 unreachable
written   .bellwether/selected

Most of a test suite cannot fail on most commits. A change to the proration code in billing does not reach the search indexer, and yet a run-everything pipeline makes you wait for the indexer tests before you can merge. Bellwether removes that wait without guessing.

How the map is built

The first time you run it, Bellwether attaches a recorder to your test process and notes every file each test opens, imports or requires. That is not a model of your architecture. It is the list of files that test actually touched, kept per test, not merged into one coverage number.

Every full run that happens for any other reason, whether the nightly job or a release build, refreshes the map. There is no pipeline step whose only job is to keep Bellwether informed.

How a selection is made

On a pull request, bellwether select takes the diff against the base branch and looks up every test whose map entry includes a changed file. Those tests are written to .bellwether/selected, and your existing test command reads that file instead of a glob. Everything else is written to the skip report with its reason.

Two rules decide the edge cases, and both fail towards running more:

  • A test whose map entry is older than its own file always runs.
  • A test that has never been mapped always runs.

When it selects everything

Change the base image, the lockfile or the CI definition and every test is downstream of the change. Bellwether selects the whole suite and says so. A tool that reported a saving on that commit would be describing the commit, not measuring it.

The other three