Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 7.1 update => test coverage drop #1074

Open
lafeber opened this issue Oct 13, 2023 · 6 comments
Open

Rails 7.1 update => test coverage drop #1074

lafeber opened this issue Oct 13, 2023 · 6 comments

Comments

@lafeber
Copy link

lafeber commented Oct 13, 2023

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.

@leesmith
Copy link

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...

@srabuini
Copy link

Have a look at #718

@matteeyah
Copy link

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

@yknx4
Copy link

yknx4 commented Jan 10, 2024

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

@dtgay
Copy link

dtgay commented Jan 11, 2024

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)

@lafeber
Copy link
Author

lafeber commented Mar 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants