Selective Test Execution at Stripe: Fast CI for a 50M-line Ruby monorepo
Stripe faces a monstrous testing problem: a single Ruby monorepo of roughly 50 million lines of code, about 100,000 test files and some 1.2 million test units. Run everything end to end and a single build would take four months — which, to put it mildly, is untenable. It has been reported that Stripe’s engineers implemented a selective test execution system to avoid that fate and bring CI back down to human timescales.
How the selection works (big picture)
It has been reported that the system chooses only the tests that matter for a given change rather than re-running the entire suite. The approach, according to Stripe’s write-up, leans on mapping changes to the tests they affect, using repository metadata, historical test outcomes and runtime signals to predict what needs to run, and then running those tests in parallel with caching where possible. The result is less wasted work — fewer tests run, fewer CPU-minutes burned, and developers who don’t have to wait forever for feedback.
Why this matters beyond Stripe
The emotional payoff is obvious: faster feedback, fewer interrupted workflows, and fewer merge conflicts caused by stale tests. It has been reported that Stripe saw dramatic CI speedups and improved developer velocity, a reminder that infrastructure work can be as impactful as product features. As more companies wrestle with monorepos and massive test suites, selective execution is quickly moving from niche trick to essential tool — who wouldn’t want their CI to behave like a laser instead of a sledgehammer?
Sources: stripe.dev, Lobsters
Comments