1

I am using Rcov for code coverage. When I run the entire spec folder, it underreports the coverage as 9% for that particular file. (I am sure the code is getting covered). When I run only that particular spec file it reports the coverage as 98% for the same file.

Any idea as to why this might happen?

  • When last I used rcov it had a bug or bugs which resulted in under-reporting coverage. I don't recall if that was affected by running specs separately or together. But simplecov doesn't have that problem; try it. – Dave Schweisguth Jun 30 '14 at 15:48
  • I switched to simplecov and still the same. Can it be something to do with running the test suite in parallel? I am using spork. But if that is the case then why is everything else being reported correctly? – bansalnagesh Jul 01 '14 at 06:08
  • You mean you're using spork both when you run the single spec and all specs? You should add that to the question, and also try running without spork. I haven't used spork, but spring definitely interferes with coverage. – Dave Schweisguth Jul 01 '14 at 10:30
  • I tried using without spork, still the same issue. – bansalnagesh Jul 02 '14 at 11:35
  • Puzzling. It might help to post an example of what it's covered. – Dave Schweisguth Jul 02 '14 at 15:32
  • 1
    Found the issue. One of the other spec file was reloading the main file due to which the coverage value was reset. Phew!! – bansalnagesh Jul 03 '14 at 17:16

0 Answers0