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.
- 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
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.
Round 1 · split by count
Round 2 · Bunpō timed split
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.
Round 1 · split by count
Round 2 · Bunpō timed split
4.07x faster than 1 machine (25m 30s to 6m 16s). Predicted 5m59s on all four shards. Dashed line marks the slowest count-split machine (6m 36s).
Local 4-CPU-pinned trial, serial pytest --use-postgres. Slightly over 4x because each shard starts with a fresh Postgres 18 database instead of 25 minutes of session churn.
Cold run · split by count
Warm run · Bunpō timed split
Cold workflow cut from 19m 47s to 9m 58s (49.6% shorter). Warm slowest job dropped to 7m 32s; verify + merge took 16 s. Dashed line marks the slowest count-split machine (8m 46s).
Live GitHub Actions (v0.0.5 via nuggocto/bunpo@v0), x64 + ARM64. Machine 0 (x64) is faster than Machine 1 (ARM64), and in the warm run another CI job queued x64 for 13m 09s. Static splitting balances file weight, not mixed hardware speed or runner queues.
Run 1 · split by count
Run 3 · Bunpō timed split
Predicted ratio 1.021 (under the 1.10 target). Measured wall ratio 1.028.
Declared benchmark in docs/benchmark.md (pytest setup: 134 ms). Includes 134 ms fixed pytest startup per machine. See /benchmarks for the Tight (1.104) and Indivisible (2.995) cases where file-level LPT cannot balance evenly.
Read all benchmark tables, tight splits, and indivisible-file limits →
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.
- uses: nuggocto/bunpo@v0 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 .
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.
Standard output carries file lists. Messages go to standard error.
- split
bunpo split --index N --total Mreads the test list from standard input, prints machine N's share, and writes.bunpo/manifest-N.jsononly after the full list is written. - 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.
- record
bunpo record --index N report.xmlsums 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. - verify
bunpo verifyandbunpo mergerun in a final job.verifyproves every file was assigned once from the same inputs;mergeupdates the rolling 5-run median intimings.jsonand 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.
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.
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.
- pytest JUnit XML (xunit1) · File arguments guide →
- Jest JUnit XML (jest-junit) · Anchored escaped regex guide →
- Vitest Two-column (--format lines) · include from BUNPO_TESTS_FILE guide →
- RSpec JUnit XML (rspec_junit_formatter) · File arguments guide →
- Playwright JUnit XML (classname + prefix) · --test-list guide →