Repository navigation
Add support for oneshot_lines coverage mode - #1154
Conversation
| def process_coverage_result | ||
| adapt_coverage_result | ||
| remove_useless_results | ||
| adapt_coverage_result |
There was a problem hiding this comment.
In this PR, Coverage.stub_line is used, which is a pretty costly method. So I swapped lines here to filter unneeded files first before doing the actual work.
|
Looking good to merge |
|
Merged. Looks good to me. |
|
Why it produces a syntax error? |
|
It seems that simplecov is evaluating .yml files in config folder like as it they were .rb files. |
|
Had it worked before with other modes? |
|
My suite is all green without any error when I removed the 2 lines : enable_coverage :oneshot_line
primary_coverage :oneshot_lineI will try to find time to make a repro app, probably next week. |
|
Curiously, with the monkey patch, it worked but it does not run faster. My suite has 7168 runs, 42714 assertions and runs in about 55 seconds on mac m4 pro (12 cpu). |
|
I noticed that the coverage for some projects takes a lot of time, but for some it is not. 55 seconds is already very fast. Try to see if there is any difference between the modes in your app on mac m4. Disable the simplecov completely and add a code somewhere in the initializer and test the difference between require "coverage"
Coverage.start(lines: true)
Coverage.resultvs require "coverage"
Coverage.start(oneshot_lines: true)
Coverage.result |
|
No difference nor bug with the snippets you gave. I think I found the problem. The bugs occurs when combining I use enable_coverage_for_eval to have coverage on my views. |


Closes #710.
https://bugs.ruby-lang.org/issues/15022
We use coverage on CI and I noticed that it significantly slows down the tests. After experimenting with
oneshot_linescoverage mode, the runtime dropped a lot (it was 15 minutes before and now is 10 minutes).