Support for https://github.com/microsoft/codecoverage #4908
Replies: 1 comment
|
Hi, Microsoft Code Coverage is NuGet/SDK tooling ( Test projects (
|
| Approach | Cake setting | Docs |
|---|---|---|
| Collector + format on CLI | Collectors |
above |
.runsettings file |
Settings |
DotNetTestSettings |
| Output location | ResultsDirectory |
DotNetTestSettings |
| MSBuild properties (e.g. disable native instrumentation) | MSBuildSettings |
DotNetTestSettings |
Anything not yet modeled (e.g. --config-file for testconfig.json) |
ArgumentCustomization |
ToolSettings |
Example with testconfig.json via WithArgumentCustomization:
var settings = new DotNetTestSettings
{
PathType = DotNetTestPathType.Project,
Collectors = { "Code Coverage;Format=cobertura" },
ResultsDirectory = "./artifacts/TestResults"
}.WithArgumentCustomization(args =>
args.AppendSwitchQuoted("--config-file", " ", "./testconfig.json"));
DotNetTest("./tests/MyTests/MyTests.csproj", settings);Non-test apps (dotnet-coverage collect ...)
That path is separate from DotNetTest. Use DotNetTool or the Command alias for the dotnet-coverage global/local tool.
Should this be an external extension?
No extension is required for basic coverage collection. DotNetTest plus NuGet packages is sufficient.
An optional addin could make sense only for higher-level workflow (auto-discovering cobertura files under TestResults, chaining ReportGenerator, CI publish helpers), not for invoking --collect itself.
Hope that helps. Let us know if you hit a specific scenario that does not map cleanly to the settings above.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
do you plan support for https://github.com/microsoft/codecoverage
it should be external extension?
All reactions