Programming Digest
Read post

Selective Test Execution at Stripe: Fast CI for a 50M-line Ruby monorepo

Stripe's engineering team describes how they built a Selective Test Execution (STE) system for their 50-million-line Ruby monorepo with ~1.2 million test units. Rather than static analysis (which fails with Ruby's dynamic nature), STE uses a C++ shared library loaded via LD_PRELOAD to intercept open syscalls and record which files each test actually accesses at runtime. This file-level dependency graph is stored as roaring bitmaps in a compact selection index. When a new build starts, changed files are detected via hashdeep (including generated artifacts), mapped to bitmap indexes, and unioned to find impacted tests. The result: only ~5% of tests run on average (median 0.5%), using less than 10% of the compute of a full run. The system includes guardrails for edge cases like directory-globbing tests, previously failing tests, and linters. Build baseline metadata is stored in MongoDB with Monotonic Revision IDs for fast, reproducible selection.

    #general-programming#cicd#ruby
May 31•12m read time•From stripe.dev
Post cover image
Table of contents
Building a dependency graph by intercepting file opensGoing from raw logs to a compact selection indexMaking it reliable at scaleWrapping up
371 Impressions
Programming Digest's image
Programming Digest

Programming Digest is a curated collection of articles, tutorials, and resources for software develo...

242 Followers

•

2.7K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard