Coverlet MSBuild does not generate XML output #1424
Replies: 3 comments
-
I'm having the same issue ever since I updated to .Net 7. Do I need to change anything in my parameters? --configuration Debug --logger trx --results-directory Test -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=coverage.cobertura.xml |
Beta Was this translation helpful? Give feedback.
-
This is a known issue in the .NET 7 SDK (not in Coverlet), see #1391 for discussion and workarounds. If you don't explicitly need the msbuild driver, consider switching to the vstest driver instead which isn't affected by this issue, and is also recommended for CI builds: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md |
Beta Was this translation helpful? Give feedback.
-
Hi all, the issue mentioned by @petli was fixed by the microsoft guys with sdk 7.0.101 that was released last week microsoft/vstest#4014. I just checked it with a repro from another related issue and it works fine. So with the new sdk you can work with the |
Beta Was this translation helpful? Give feedback.
-
I am running the following: dotnet test --logger "trx;LogFileName=TestResults.trx" --logger "xunit;LogFileName=TestResults.xml" --results-directory ./BuildReports/UnitTests /p:CollectCoverage=true /p:CoverletOutput=BuildReports/Coverage/ /p:CoverletOutputFormat=opencover /p:Exclude="[xunit.]"
This runs to completion without error, however, I am not sure why (and this only happened since our update to .Net 7) the coverage output that is generated is in json format not the expected coverage.cobertura.xml that our Sonarqube is expecting.
Is this something that has changed for .Net 7 or am I missing an additional property?
Beta Was this translation helpful? Give feedback.
All reactions