Skip to content

Commit 619882d

Browse files
authored
Update documentation to clarify compatibility of coverlet.collector and coverlet.msbuild with Microsoft Testing Platform (MTP v2) (#1982)
1 parent f549c8b commit 619882d

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

Documentation/KnownIssues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This happen also if there are other "piece of code" during testing that slow dow
4747

4848
*Solution:*
4949

50-
The only way to get around this issue is to use collectors integration <https://github.com/coverlet-coverage/coverlet#vstest-integration-preferred-due-to-known-issue-supports-only-net-core-application>. With the collector, we're injected in test host through a in-proc collector that communicates with the VSTest platform so we can signal when we end our work.
50+
The only way to get around this issue is to use **coverlet.collector** integration. With the collector, we're injected in test host through a in-proc collector that communicates with the VSTest platform so we can signal when we end our work.
5151

5252
## Upgrade `coverlet.collector` to version > 1.0.0
5353

Documentation/MSBuildIntegration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Coverlet integration with MSBuild
22

3+
> [!IMPORTANT]
4+
> **`coverlet.msbuild` is not compatible with the Microsoft Testing Platform (MTP v2).**
5+
>
6+
> This is particularly important if you're using the native `dotnet test` integration introduced in **.NET 10**, which can run tests through the Microsoft Testing Platform.
7+
>
8+
> The `coverlet.msbuild` package relies on **MSBuild test targets** that are part of the **VSTest** execution model. Because the **Microsoft Testing Platform** uses a different test execution architecture and does not invoke these targets, `coverlet.msbuild` cannot collect code coverage when running with MTP v2.
9+
>
10+
> For more information, see: [*Use Microsoft.Testing.Platform in the VSTest mode of `dotnet test`*](https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-integration-dotnet-test).
11+
312
In this mode, Coverlet doesn't require any additional setup other than including the `coverlet.msbuild` NuGet package in the unit test project. It integrates with the `dotnet test` infrastructure built into the .NET Core CLI and when enabled, will automatically generate coverage results after tests are run.
413

514
If a property takes multiple comma-separated values please note that [you will have to add escaped quotes around the string](https://github.com/Microsoft/msbuild/issues/2999#issuecomment-366078677) like this: `/p:Exclude=\"[coverlet.*]*,[*]Coverlet.Core*\"`, `/p:Include=\"[coverlet.*]*,[*]Coverlet.Core*\"`, or `/p:CoverletOutputFormat=\"json,opencover\"`.

Documentation/VSTestIntegration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Coverlet integration with VSTest (a.k.a. Visual Studio Test Platform)
22

3+
> [!IMPORTANT]
4+
> **`coverlet.collector` is not compatible with the Microsoft Testing Platform (MTP v2).**
5+
>
6+
> This is particularly important if you're using the native `dotnet test` integration introduced in **.NET 10**, which can run tests through the Microsoft Testing Platform.
7+
>
8+
> The `coverlet.collector` package is built on the **VSTest** data collector infrastructure. Because the **Microsoft Testing Platform** uses a different test execution architecture and does not support VSTest data collectors, `coverlet.collector` cannot be used with MTP v2.
9+
>
10+
> For more information, see: [*Use Microsoft.Testing.Platform in the VSTest mode of `dotnet test`*](https://learn.microsoft.com/en-us/dotnet/core/testing/microsoft-testing-platform-integration-dotnet-test).
11+
312
**Supported runtime versions**:
413

514
Since version `8.0.0`

0 commit comments

Comments
 (0)