You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commits adds the option `IntermediateResult`, which will write the
raw coverage result to an intermediate file, and merge the result of the
next run with that file. This is useful in multi-project solutions.
Eventually, the last coverage run will produce a report with the
combined results of all the runs.
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,16 @@ dotnet test /p:CollectCoverage=true /p:Threshold=80 /p:ThresholdType=line
82
82
83
83
You can specify multiple values for `ThresholdType` by separating them with commas. Valid values include `line`, `branch` and `method`.
84
84
85
+
### Intermediate Result
86
+
87
+
For combining the results of multiple projects, it is possible to use an intermediate result by using the `CoverletIntermediateResult` property. Coverage output will be merged with an intermediate result before generating the report(s). Ensure that all test runs point to the same intermediate result file.
88
+
89
+
```bash
90
+
dotnet test /p:CollectCoverage=true /p:CoverletIntermediateResult=intermediate.json
91
+
```
92
+
93
+
_Note: When using build automation, ensure that this intermediate result file is removed first. It doesn't make sense to merge with an intermediate result from a different build!_
Copy file name to clipboardExpand all lines: src/coverlet.console/Program.cs
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ static int Main(string[] args)
18
18
19
19
CommandArgumentproject=app.Argument("<PROJECT>","The project to test. Defaults to the current directory.");
20
20
CommandOptionconfig=app.Option("-c|--configuration","Configuration to use for building the project.",CommandOptionType.SingleValue);
21
+
CommandOptionintermediateResult=app.Option("-i|--coverage-intermediate-result","The output path of intermediate result (for merging multiple runs).",CommandOptionType.SingleValue);
21
22
CommandOptionoutput=app.Option("-o|--coverage-output","The output path of the generated coverage report",CommandOptionType.SingleValue);
22
23
CommandOptionformat=app.Option("-f|--coverage-format","The format of the coverage report",CommandOptionType.SingleValue);
0 commit comments