Closed CraigChamberlain closed 3 years ago
Found an example here.:
dotnet test --collect:"XPlat Code Coverage" --DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=json,cobertura,lcov,teamcity,opencover
However this seems to suggest it does not support the sdk version, only the MSBuild Version? The same error occurred after adding the coverlet.msbuild package.
dotnet test --collect:"XPlat Code Coverage" --DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
MSBUILD : error MSB1001: Unknown switch.
Switch: --DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
Similar Issue here https://github.com/coverlet-coverage/coverlet/issues/755.
Look carefully at the example, it has a space between --
and the format parameter:
dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=json,cobertura,lcov,teamcity,opencover
--
on its own is used to separate parameters to the dotnet test
command and parameters to the test framework.
Hell of a spot. Thanks so much. Working a charm now.
C
On Mon, 2 Nov 2020 at 13:40, Peter Liljenberg notifications@github.com wrote:
Look carefully at the example, it has a space between -- and the format parameter:
dotnet test --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=json,cobertura,lcov,teamcity,opencover
-- on its own is used to separate parameters to the dotnet test command and parameters to the test framework.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/coverlet-coverage/coverlet/issues/984#issuecomment-720478526, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALRDEQYY6E7LR6J2JGFVYZDSN2ZGLANCNFSM4THOT4NA .
-- *Craig Chamberlain | *IT Services {tel: 07526825153} {web: www.craigchamberlain.it}
Good to hear!
I have found several examples as follows which work fine:
However, I've also read that the following should work
As I'm trying to output opencover format to upload to Coveralls.io it would be great if I could export in another format.