You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There appears to be an pretty severe inconsistency between the cobetura output in .NET 7 and .NET 8. Please see issue below for details.
Expected behavior
Output should be consistent across runtimes. Or at a minimum there should be a flag to have .NET 8 output the full path to the file.
Actual behavior
See linked issue.
Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used? 6.0.0
* Which version of .NET is the code running on? . SDK 8.0.300 and 7.0.409
* What OS and version, and what distro if applicable? Windows
* What is the architecture (x64, x86, ARM, ARM64)? X64
* Do you know whether it is specific to that configuration?
Additional context
Add any other context about the problem here.
Hi!
I have exactly the same issue with an extra twist. After switching .NET 8 the filenames changed from c:\users\me\...\ProjectA\ClassA.cs to https://github.com/.../ProjectA/ClassA.cs. The additional problem on my side is that these filenames are both present in the same coverage.cobertura.xml.Most of them is the new https version but some of them still refer to my filesystem. Unfortunately we use some futher tools to process these files (for example reportgenerator) and the calculated coverage is incorrect due to a inconsistent filenames.
I do some research and I found the following:
New filenames: it is the result of a breaking change in .NET 8 more information can be found here and here. So in this case I think when UseSourceLink option is turned on this is a normal behaviour. However in this method https://github.com/coverlet-coverage/coverlet/blob/master/src/coverlet.core/Reporters/CoberturaReporter.cs#L216 when source links are disabled it returns only the filename (probably it is correct) but comparing to previous .NET versions I have the feeling that source links are mixed up with full physical paths. I don't know but maybe a clarification would be great.
About the mixed filenames: After a few test and detailed logging I think I found the problem: https://github.com/coverlet-coverage/coverlet/blob/master/src/coverlet.core/Coverage.cs#L368 between line 368 and 387. If there is no hits for an assembly the sourcelink is not used but I think this is not a correct or expected behaviour. If we reference a not covered assembly but would like to use sourcelinks the filename attribute should refer to them as well in the output file. A naive solution could be to change the order of the two if condition but I'm not familier with this project so I don't know what could be the consequences.
Describe the bug
There appears to be an pretty severe inconsistency between the cobetura output in .NET 7 and .NET 8. Please see issue below for details.
To Reproduce
See microsoft/azure-pipelines-tasks#19901 for the difference in output between .NET 7 and .NET 8
Expected behavior
Output should be consistent across runtimes. Or at a minimum there should be a flag to have .NET 8 output the full path to the file.
Actual behavior
See linked issue.
Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used? 6.0.0
* Which version of .NET is the code running on? . SDK 8.0.300 and 7.0.409
* What OS and version, and what distro if applicable? Windows
* What is the architecture (x64, x86, ARM, ARM64)? X64
* Do you know whether it is specific to that configuration?
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: