This project has moved. For the latest updates, please go here.
1

Closed

Merging XML files makes me lose coverage data

description

When I run a report with one XML file, I get 80% and 90.8% coverage in a particular library. However, when I merge it with other XML files, the coverage goes down. Is there a way I can preserve code coverage when merging?
Closed Feb 26, 2015 at 7:50 PM by danielpalme

comments

danielpalme wrote Feb 26, 2015 at 10:29 AM

Do the other XML files only cover your "particular library" or do they cover other libraries too?
If they cover other code too, then the overall coverage can be different from the coverage of a single XML file.
But the coverage you a particular library should never become lower with several xml files.

Can you provide a concrete example?

BillLuc1982 wrote Feb 26, 2015 at 1:05 PM

I would like to attach two XML files, but I also do not want to give away the code since it's proprietary. Only the HTML pages have the code, not the XML files. Correct?

Also, my XML files are 135MB each. Should I e-mail you a .zip file with the 2 XML files?

danielpalme wrote Feb 26, 2015 at 2:15 PM

The XML does not contain any code.
Could you upload the XML files to Dropbox/Google Drive/Onedrive and share the link?
270MB is too big for email.

Please send the link to:
danielpalme82 [at] gmail.com

danielpalme wrote Feb 26, 2015 at 7:49 PM

I created three reports. One for each XML alone, and one combined report.

The first XML does not yet cover all classes (compared to second XML).
And the classes are not the same between the two test runs.
That means you have executed your tests against different versions of the same DLL.

That's the reason why some results look strange.
One class contains 9 coverable lines in the first run, 10 in the second and 16 in the combined report.
This looks strange at first glance. But it is correct, because the class was changed between test runs and the line order of some methods changed as well.

Make sure your tests are executed against the same version of the DLL and your results will look fine again.

wrote Feb 26, 2015 at 7:50 PM