Hi folks,
After upgrading a Rails app from 7.1.5.2 → 7.2.2.1, I started seeing coverage drop and fluctuate between runs when running the test suite in parallel. The project uses parallel_tests
(parallel_rspec
) and SimpleCov
0.22.0. Prior to the Rails upgrade, the suite consistently reported 100% coverage; after the upgrade, coverage is lower and varies on each run.
I’ve tried the obvious fixes—moving SimpleCov.start
earlier, setting a per-worker command_name
, collating results, and forcing eager loading during coverage runs—but the problem persists. Below are exact config snippets, how I run tests, what I’ve tried, and questions/debugging requests. Any help or suggestions would be greatly appreciated.
Environment / relevant gems
-
Rails: 7.2.2.1 (previously 7.1.5.2)
-
SimpleCov: 0.22.0
-
Test runner: RSpec + parallel_tests
CI command used:
RAILS_ENV=test COVERAGE=1 bin/rails parallel:spec
I believe the issue is related to one of the gems rather than Rails itself, but I would appreciate any guidance here.