Only the "CollectCoverage" property is working
See original GitHub issueI’m following the guide here to try and use coverlet to create a code coverage report.
In summary, I’ve run the following commands:
dotnet new xunit -n XUnit.Coverlet.MSBuild
cd XUnit.Coverlet.MSBuild
dotnet add package coverlet.msbuild
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
The issue is with the final step, where the output is:
So the output is still the default “coverage.json” instead of the expected cobertura xml.
So I tested with some other properties, and they also don’t work:
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
And the output is exactly the same:
I’ve run the same thing on my home PC, and it is not having the same issues.
The only difference I can think of is that the PC with the issue is a Windows Server 2016 machine, and my home PC is a Windows 10.
I’ve tried a complete uninstall and reinstall of Visual Studio which didn’t help.
Can anyone suggest a way I can get this to work?
Issue Analytics
- State:
- Created 10 months ago
- Comments:6
Top Results From Across the Web
Not able to collect coverage in Jest
The test execution is running fine. However I am not able to collect code coverage correctly. The coverage is only logged for folder...
Read more >Jest is "stuck" on only generating coverage for tested files ...
We are running jest, specifying to test only certain files, then trying to collect coverage on the entire src directory.
Read more >Coverlet does not generate single coverage report file for ...
Hi Team,. We are trying to generate and report Code Coverage to azure server using Coverlet and ReportGenerator. We are collecting coverage ...
Read more >coverlet
Enabling code coverage is as simple as setting the CollectCoverage property to true. dotnet test /p:CollectCoverage=true. After the above command is run, ...
Read more >Use code coverage for unit testing - .NET
Code coverage is a measurement of the amount of code that is run by unit tests - either lines, branches, or methods. As...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I close this as the external issue is fixed. Feel free to reopen.
Tried this instead based on a comment in #1391 and it worked.
dotnet test -p:CollectCoverage=true -e:CoverletOutputFormat=cobertura -e:CoverletOutput='../../TestResults/'