分蜂 · the bees dividing their hive

Balance CI test suites by timing and verify every assignment.

Split tests by name and one machine gets the slow files while the others sit idle. Bunpō remembers how long each file took, deals them out longest first, and fails the build if a stale cache leaves a file unassigned or duplicated. It is one static binary with no server. Timings live in your own CI cache.

Mitsu, a round honey-brown and cream bee with mint wings and a honeycomb satchel, holding out a hexagonal cell
Mitsu · cells of equal weight
Postgres suite (4 machines)
25m 30s → 6m 16s (4.0x)
Playwright CI (2 runners)
19m 47s → 9m 58s (-49.6%)
binary
3.2 MiB, Go stdlib only
hosting
None, uses your CI cache
Before & after Measured time saved

Cut 19 minutes off a Postgres suite, and 2 minutes off a count-based split.

Measured machine times from two production repositories (local 4-CPU trials and a live GitHub Actions Playwright run on v0.0.5) alongside the declared 40-file benchmark. Switch suites to compare before and after on each machine.

1 machine → count split 8m 10s → 4m 15s
with Bunpō timings 2m 08s slowest shard
time saved 6m 02s saved (3.84x faster)
113 pytest files · 2,777 tests · PostgreSQL 16 · 4 machines 2m 07s faster than splitting by count · spread cut from 179.5s to 7.3s

Round 1 · split by count

slowest 4m 15s · 179.5s spread

Machine 0 (29 files ) 1m 16s
Machine 1 (28 files ) 1m 15s
Machine 2 (28 files · 131s WS file) 4m 15s
Machine 3 (28 files ) 1m 42s

Round 2 · Bunpō timed split

slowest 2m 08s · 7.3s spread

Machine 0 (1 file · 131s WS alone) 2m 08s
Machine 1 (36 files ) 2m 02s
Machine 2 (40 files ) 2m 06s
Machine 3 (36 files ) 2m 00s

3.84x faster than 1 machine (8m 10s to 2m 08s). Spread dropped from 179.5 s to 7.3 s. Dashed line marks the slowest count-split machine (4m 15s).

Local 4-CPU-pinned trial, serial pytest --use-postgres. Each shard runs its own Postgres testcontainer. Test-command wall time only; CI checkout and dependency install are extra.

Read all benchmark tables, tight splits, and indivisible-file limits →

Install GitHub Actions or any CI

One line in GitHub Actions, or one static binary anywhere else.

The Action downloads the binary for Linux, macOS, or Windows (x86-64 and ARM64), checks it against SHA256SUMS, and puts bunpo on PATH. Your workflow calls the CLI directly so standard input and every flag stay visible.

GitHub Actions
- uses: nuggocto/bunpo@v0
Direct download (v0.0.6, Linux x86-64)
curl -fsSLO https://github.com/nuggocto/bunpo/releases/download/v0.0.6/bunpo-linux-amd64
curl -fsSLO https://github.com/nuggocto/bunpo/releases/download/v0.0.6/SHA256SUMS
sha256sum --ignore-missing -c SHA256SUMS
chmod +x bunpo-linux-amd64 && mv bunpo-linux-amd64 /usr/local/bin/bunpo

Need macOS, Windows, or ARM64? Grab the matching binary from GitHub Releases .

How it works Split, record, verify, merge

Deal the slowest files first, then verify every machine saw the same split.

Take six files that run in 9, 7, 6, 5, 4, and 3 minutes across two machines. Splitting alphabetically stacks the three heaviest files onto machine 0 (22 minutes) while machine 1 finishes in 12. Bunpō deals longest first to whichever machine has the smallest load: 9 + 5 + 3 and 7 + 6 + 4, 17 minutes each, cutting 5 minutes off the build. Each machine writes its share and a SHA-256 digest of its inputs into a manifest, and bunpo verify checks every manifest at the end so a stale cache cannot drop or double-run a file.

machine 0 17m
auth
export
search
machine 1 17m
billing
checkout
health
assignment verified: 6 tests across 2 machines, each assigned exactly once, all split from the same input and timings (digest 4e9a1b0f2c8d…) bunpo: this checks what each machine was asked to run, not what ran; check each runner's result and report separately
In your pipeline Four plain commands

Standard output carries file lists. Messages go to standard error.

  1. split
    bunpo split --index N --total M reads the test list from standard input, prints machine N's share, and writes .bunpo/manifest-N.json only after the full list is written.
  2. run
    Your test runner executes those exact files and writes a JUnit XML report or a two-column timing file. Empty shards skip the runner so it cannot run the whole suite by accident.
  3. record
    bunpo record --index N report.xml sums exact case durations per file, checks the report against the manifest, and refuses unassigned files. Files with failures stay seen without recording a bad time.
  4. verify
    bunpo verify and bunpo merge run in a final job. verify proves every file was assigned once from the same inputs; merge updates the rolling 5-run median in timings.json and drops files unseen for 30 runs.

verify checks assignments, not execution. Your workflow still checks runner exit statuses and expected reports; every guide below wires up both.

In the terminal Exit 0, 1, or 2

See split, record, merge, and verify catching a stale timing cache.

In GitHub Actions, warnings and failures become workflow annotations automatically. Exit status is 0 on success, 1 when a check fails, and 2 on bad input or flags.

Terminal recording of bunpo split, record, merge, and verify catching a stale timing cache on machine 2
Guides Tested on real runners

Complete GitHub Actions workflows for five runners.

Each guide is tested against the real runner with decoy files and glob characters, because runners like Jest, Vitest, and Playwright treat plain file arguments as patterns unless you lock them down.