coverlet icon indicating copy to clipboard operation
coverlet copied to clipboard

Wrong count of "branches-valid" in coverage.cobertura.xml

Open mklpanasiuk opened this issue 2 years ago • 1 comments

Steps to reproduce:

  1. Run: dotnet test --collect:"XPlat Code Coverage"
  2. Run: reportgenerator "-reports:coverage.cobertura.xml" "-targetdir:./" "-reporttypes:JsonSummary"

Actual result: Branch coverage and total branches are different between coverage.cobertura.xml and reportgenerator Summary.json

Expected result: Branch coverage and total branches are the same. Also it seems that reportgenerator calculates it right, based on my issue in their project, please see - https://github.com/danielpalme/ReportGenerator/issues/597

Please let me know to which email address I need to send an original coverage.cobertura.xml in case you need it for debugginh.

mklpanasiuk avatar Mar 27 '23 11:03 mklpanasiuk

Hi @mklpanasiuk and thanks for reporting this. I just looked into the report generation and there could be some edge cases where coverlet counts some branches in the summary that are not included in the detailed class sections of the report. Unfortunately I wasn't able to find a reasonable way how to simulate this yet.

Thanks for the offer but the report file will not help much as the additional branches we counted are missing in the class details. It would help a lot if you could provide a repro for that and we can check the coverage results in memory.

daveMueller avatar Apr 09 '23 23:04 daveMueller