Skip to content

Commit 70b3ef3

Browse files
Update collector docs (#522)
update docs
1 parent 428034d commit 70b3ef3

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

Documentation/VSTestIntegration.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
# Coverlet Integration with VSTest
22

3-
## Motivation
4-
5-
The cross platform solution for Code Coverage generation for .NET Core projects (in a consistent manner).
6-
The asks for Code Coverage support for .NET Core on Linux is the most commented issue on vstest repo:
7-
https://github.com/Microsoft/vstest/issues/981#issuecomment-320311552
8-
9-
## Summary
10-
11-
What would integrating Coverlet with Microsoft Test Platform mean:
12-
13-
1. Coverlet based coverage solution is available as a data collector that does the instrumentation of the necessary modules before test execution and appropriate restore after.
14-
2. Authoring - When new test projects are created (dotnet mstest), references to the data collector package are added by default. This reduces adoption friction for customers.
15-
3. Test execution - Today Coverlet is invoked as a msbuild target and as such only works with dotnet test (and requires a csproj). With the data collector becoming available, coverage can also be collected when tests are run on built binaries (dotnet vstest)
16-
17-
## Proposed Solution
18-
19-
### Scenarios to support
20-
21-
The following table summarizes the support that needs to be added for a seamless code coverage collection for .NET Core on both Linux and Windows platforms:
223

234
| Entry point | How will code coverage be enabled? | Syntax |
245
|-------------|------------------------------------|----------------------------------------------------------------------|
256
|dotnet test CLI | Through a switch to condition data collection | `dotnet test --collect:"XPlat Code Coverage"` |
267
|dotnet vstest CLI | Through a switch to condition data collection | `dotnet vstest --collect:"XPlat Code Coverage"` |
278

9+
NB. If you're using `dotnet vstest` you MUST `publish` your test project before i.e.
10+
```bash
11+
C:\project
12+
dotnet publish
13+
...
14+
vstest -> C:\project\bin\Debug\netcoreapp3.0\testdll.dll
15+
vstest -> C:\project\bin\Debug\netcoreapp3.0\publish\
16+
...
17+
dotnet vstest C:\project\bin\Debug\netcoreapp3.0\publish\testdll.dll --collect:"XPlat Code Coverage"
18+
```
19+
2820
### Coverlet Options Supported with VSTest
2921

3022
#### Default
@@ -75,11 +67,6 @@ This runsettings file can easily be provided using command line option as given
7567

7668
2. `dotnet vstest --settings coverletArgs.runsettings`
7769

78-
79-
#### Scope of Enhancement
80-
81-
Currently, advanced options are supported via runsettings. Providing support through additional command line arguments in vstest can be taken up separately.
82-
8370
## Implementation Details
8471

8572
The proposed solution is implemented with the help of [datacollectors](https://github.com/Microsoft/vstest-docs/blob/master/docs/extensions/datacollector.md).

0 commit comments

Comments
 (0)