opencover
opencover copied to clipboard
mergeoutput and coverbytest causes duplicated TrackedMethod uids
When merging multiple results using mergeoutput, if coverbytest is also specified, then the output TrackedMethod elements from each run start with a uid of 1. This causes the uid in the TrackedMethodRef elements to be ambiguous.
This also causes ReportGenerator to crash when reading the resulting report file.
My Framework
- [ ] .NET 2
- [ ] .NET 3.5
- [X] .NET 4
- [ ] .NET 4.5
- [ ] .NET 4.6
- [ ] .NET 4.6.1
- [ ] .NET 4.6.2
- [ ] .NET Core 1.0.0
- [ ] Something else
My Environment
- [X] Windows 7 or below (not truly supported due to EOL)
- [ ] Windows 8
- [ ] Windows 8.1
- [ ] Windows 10
- [ ] Windows 10 IoT Core
- [ ] Windows Server 2012
- [ ] Windows Server 2012 R2
- [ ] Windows Server 2016
I have already...
- [X] repeated the problem using the latest stable release of OpenCover.
- [X] reviewed the usage guide and usage document.
- [X] have looked at the opencover output xml file in an attempt to resolve the issue.
- [X] reviewed the current issues to check that the issue isn't already known.
My issue is related to (check only those which apply):
- [ ] no coverage being recorded
- [ ] 32 or 64 bit support
- [ ] feature request
Expected Behavior
The TrackedMethod uid should be unique in a manner similar to the SequencePoint uspid and File uid.
Actual Behavior
The TrackedMethod uid sequence begins at 1 with each run.
Steps to reproduce the problem:
- Run opencover two or more times using mergeoutput to merge the results into a single xml file as follows:
"%OpenCoverPath%\OpenCover.Console.exe" -register:Path32 -mergebyhash -mergeoutput -target:"%XUnitPath%\xunit.console.clr4.x86.exe" -targetargs:"ATest.dll" -coverbytest:"*ATest.dll" -targetdir:ATest\bin\x86\Debug
"%OpenCoverPath%\OpenCover.Console.exe" -register:Path32 -mergebyhash -mergeoutput -target:"%XUnitPath%\xunit.console.clr4.x86.exe" -targetargs:"BTest.dll" -coverbytest:"*BTest.dll" -targetdir:BTest\bin\x86\Debug
- Open results.xml. Module ATest's TrackedMethods and Module BTest's TrackedMethods will both start with a uid of 1.