We seem to be facing this issue with one of our projects. In our case, it might be caused by us splitting specs into several chunks that execute independently, and then merging multiple coverage reports. Apparently, SimpleCov generates zero-coverage report for (some?) files that were not covered within the chunk. E.g., for one of the files, the chunk with its tests results in a report like
"/w/some/file.rb": {
"lines": [
1,
1,
1,
1,
1,
1,
2,
null,
1,
2,
null,
1,
1,
1,
2,
null,
1,
2,
null,
1,
2,
null,
1,
2,
null,
1,
2,
null,
null,
null,
null,
null,
null
],
"branches": [
]
},
however, other chunks include
"/w/some/file.rb": {
"lines": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"branches": [
]
},
which seems to result in 0 coverage for lines having null
coverage in the main report.
We’re using SimpleCove 0.22.0 (on top of Ruby 2.6) for that project.