Summary
Add the ability to fail the build if a minimum level of coverage is not achieved.
Background and Motivation
Playing around with an existing xunit v3 project to have it use Microsoft Testing Platform, and as part of that work to maintain code coverage I've needed to drop coverlet to instead use the coverage extension.
A missing feature by comparison compared to coverlet is the ability to fail the build if a minimum code threshold isn't met.
In coverlet this is achieved via an MSBuild property in one of two formats:
<!-- Fail if line, method or branch coverage is less than 70 -->
<Threshold>70</Threshold>
<!-- Fail if line, method or branch coverage is less than 70, 75 and 50 respectively -->
<Threshold>70,75,50</Threshold>
Proposed Feature
Add a new feature that can be controlled through the command-line, for example:
This could then be customised on a per-test-project basis:
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --coverage-threshold 42</TestingPlatformCommandLineArguments>
Alternative Designs
None proposed.
Summary
Add the ability to fail the build if a minimum level of coverage is not achieved.
Background and Motivation
Playing around with an existing xunit v3 project to have it use Microsoft Testing Platform, and as part of that work to maintain code coverage I've needed to drop coverlet to instead use the coverage extension.
A missing feature by comparison compared to coverlet is the ability to fail the build if a minimum code threshold isn't met.
In coverlet this is achieved via an MSBuild property in one of two formats:
Proposed Feature
Add a new feature that can be controlled through the command-line, for example:
This could then be customised on a per-test-project basis:
Alternative Designs
None proposed.