Coverlet: For MSBuild integration multiple output formats does not work

Created on 3 Dec 2019  路  6Comments  路  Source: coverlet-coverage/coverlet

My unit test project contains coverlet.msbuild package. When I run dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover,lcov I received

MSBUILD : error MSB1006: Property is not valid.
Switch: lcov

For switch syntax, type "MSBuild -help"

image

as-designed

Most helpful comment

Ah ok sorry it was on guide try with PS C:\git\coverlet> dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat="opencover%2clcov" %2c is translated to comma.

All 6 comments

It's a know issue with escaping try with dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=\"opencover,lcov\"
Also FYI https://github.com/tonerdo/coverlet/blob/master/Documentation/MSBuildIntegration.md#note-for-powershell--vsts-users

We should update documetation

For CMD works fine, but for powershell it won't work.
CMD
image

powershell
image

Ah ok sorry it was on guide try with PS C:\git\coverlet> dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat="opencover%2clcov" %2c is translated to comma.

Yeap, now it works. You can close the ticket, but please remember to update the documentation.

Is already present...but yes a bit cryptic and hidden

To exclude or include multiple assemblies when using Powershell scripts or creating a .yaml file for a VSTS build %2c should be used as a separator. Msbuild will translate this symbol to ,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arpit-nagar picture arpit-nagar  路  4Comments

spboyer picture spboyer  路  3Comments

civspan picture civspan  路  6Comments

jamir-araujo picture jamir-araujo  路  4Comments

hlubovac picture hlubovac  路  5Comments