simplecov-ruby/simplecov

Rails 7.1 update => test coverage drop

lafeber opened this issue · 6 comments

Issue occurs when bumping rails from 7.0.8 to 7.1.0. No other changes in code.

We run minitest, with Rails 7.1 the line coverage of some files (mostly concerns) dropped from 100% to 0%.

before:
image

after:
image

I don't know how much code I'm allowed to share; it's code that's called indirectly in the tests.

simplecov is at 0.22.0

ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-darwin21]

Edit: this is without parallelisation.

I'm also having trouble getting Simplecov to work with my "out of the box" rails minitest test suite (only have model tests and integration tests). I followed the install instructions and made the suggested changes to both the test/test_helper.rb file as well as the change to bin/rails.

@lafeber One thing I've done to produce different results is comment out this line in my test/test_helper.rb file:

parallelize(workers: :number_of_processors)

I don't think this is the fix but see what it does for you...

Have a look at #718

I'm running into this as well. @colszowka Can you take a look at this please?

yknx4 commented

I'm having the same issue with Rspec instead of Minitest. Only on our Rails 7.1 branch

dtgay commented

We're getting similar results, specifically with controllers. Other files are being covered correctly. Confirmed that simplecov is being initialized before controllers run. Running Rails 7.1 + minitest.

EDIT: My issue was Rails test parallelization. Fix here: #718 (comment)

I've managed to "fix" it following this issue: #1082