Coverlet: [Questi谋on] - converlet.collector or coverlet.msbuild

Created on 29 May 2020  路  1Comment  路  Source: coverlet-coverage/coverlet

Which package do I have to add to my project? I mean, what are the differences?

When I create a new dotnet core xUnit test project, it adds coverlet.collector package automatically.

It would be better a short description on NuGet pages. ( same description for all coverlet packages)

question

Most helpful comment

Which package do I have to add to my project? I mean, what are the differences?

Coverlet comes in more than one flavours, msbuild task integration, vstest collectors integration and as .net tool. The coverage engine is shared but the way you use it depends on your needs. Someone wants msbuild others run as external tool and so on. Btw msbuild and .net tool sometimes suffer of know issue related to vstest default behaviour(https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md#1-vstest-stops-process-execution-earlydotnet-test), due to this and also because it's the only cross plat code coverage tool we and Microsoft guys decided to add new integration using build-in mechanism called collectors.

Collectors are pretty new(last arrived) and are the best way to do coverage because are strictly integrated with vstest platform(dotnet test) and due to that is the default choice for every .NET core xunit project by Microsoft.
So if you create xunit project Microsoft xunit template inject by design our coverage engine as first class coverage tool running with dotnet test --collect:"XPlat Code Coverage"

I've just updated the guide to better clarify https://github.com/coverlet-coverage/coverlet#vstest-integration-preferred-due-to-known-issue-supports-only-net-core-application

Feel free to close if solved!

>All comments

Which package do I have to add to my project? I mean, what are the differences?

Coverlet comes in more than one flavours, msbuild task integration, vstest collectors integration and as .net tool. The coverage engine is shared but the way you use it depends on your needs. Someone wants msbuild others run as external tool and so on. Btw msbuild and .net tool sometimes suffer of know issue related to vstest default behaviour(https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md#1-vstest-stops-process-execution-earlydotnet-test), due to this and also because it's the only cross plat code coverage tool we and Microsoft guys decided to add new integration using build-in mechanism called collectors.

Collectors are pretty new(last arrived) and are the best way to do coverage because are strictly integrated with vstest platform(dotnet test) and due to that is the default choice for every .NET core xunit project by Microsoft.
So if you create xunit project Microsoft xunit template inject by design our coverage engine as first class coverage tool running with dotnet test --collect:"XPlat Code Coverage"

I've just updated the guide to better clarify https://github.com/coverlet-coverage/coverlet#vstest-integration-preferred-due-to-known-issue-supports-only-net-core-application

Feel free to close if solved!

Was this page helpful?
0 / 5 - 0 ratings