A detailed case study from Evil Martians on optimizing a 30k-spec Rails test suite at Whop, cutting RSpec CI time from 4m30s to under 2 minutes. Key findings include: a memory leak caused by RuboCop's global RSpec hook integrating plugins for every example group, code coverage overhead reduced by switching to SimpleCov's oneshot_line mode, blind_index encryption using production-level Argon2id settings in tests, and a new TPS (tests-per-second) profiler in TestProf v1.6.0 to identify high-impact slow test files. Specific fixes are shown for GraphQL type resolution iterating over ObjectSpace per example, retry mechanisms using production backoff delays, and over-creating database records to test boundary conditions.

15m read timeFrom evilmartians.com
Post cover image
Table of contents
The Whop chop: how we cut a Rails test suite and CI time in halfCustom RuboCop cops and suspiciously high GC timeTo coverage or not to coverage, or how to coverage?The cost of encryptionThe most useful metric—tests-per-secondIn the next issues

Sort: