Failure thresholds mtp - #2019
Open
Bertk wants to merge 12 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds coverage failure-threshold support to the coverlet.MTP extension, aligning it with existing threshold behavior in other Coverlet drivers, and updates the MTP integration documentation and tests accordingly.
Changes:
- Introduces threshold settings (
Threshold,ThresholdType,ThresholdStat) in MTP settings/config parsing and exposes them via command-line options. - Adds threshold evaluation/output in the collector and sets a non-zero exit code when thresholds are not met.
- Updates MTP docs and adds/extends unit tests around parsing/validation and threshold reporting.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| test/coverlet.MTP.tests/Configuration/CoverletMTPSettingsTests.cs | Extends settings default/to-string tests for threshold fields. |
| test/coverlet.MTP.tests/Configuration/CoverletMTPSettingsParserTests.cs | Adds config parsing test coverage for threshold settings. |
| test/coverlet.MTP.tests/CommandLine/CoverletMTPCommandLineTests.cs | Adds validation tests for new threshold-related CLI options. |
| test/coverlet.MTP.tests/Collector/CollectorExtensionThresholdTests.cs | New tests verifying threshold summary output formatting. |
| src/coverlet.MTP/Configuration/CoverletMTPSettingsParser.cs | Parses threshold-related settings from configuration. |
| src/coverlet.MTP/Configuration/CoverletMTPSettings.cs | Adds threshold fields to settings and includes them in ToString output. |
| src/coverlet.MTP/Configuration/CoverletMTPConstants.cs | Adds config keys/defaults for threshold settings. |
| src/coverlet.MTP/Configuration/CoverletExtensionConfiguration.cs | Adds threshold fields to collector configuration model. |
| src/coverlet.MTP/Configuration/CoverageConfiguration.cs | Adds threshold getters that unify CLI vs config sources. |
| src/coverlet.MTP/CommandLine/CoverletOptionNames.cs | Defines option names for threshold-related CLI options. |
| src/coverlet.MTP/CommandLine/CoverletExtensionCommandLineProvider.cs | Validates threshold CLI arguments (range, enum values, coverage types). |
| src/coverlet.MTP/CommandLine/CoverletCommandLineOptionDefinitions.cs | Registers threshold CLI options and their arities/descriptions. |
| src/coverlet.MTP/Collector/CollectorExtension.cs | Implements threshold evaluation, reporting, and exit code behavior. |
| global.json | Updates pinned .NET SDK version. |
| Documentation/DriversFeatures.md | Updates feature matrix for MTP threshold support (and .NET Framework support). |
| Documentation/Coverlet.MTP.Integration.md | Documents threshold CLI/config options and updates configuration tables. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Add CoverletCoverageDataProducer for MTP message creation/publishing - CollectorExtension now publishes coverage, threshold, and report messages to IMessageBus - Refactor exit code logic for threshold failures - Update CollectorExtensionProvider for DI of message bus and producer - Refactor and add tests for message-based reporting and producer logic - Update integration test for new summary output - Bump MicrosoftTestingPlatformVersion to 2.4.0 - Update .github/copilot-instructions.md for test/code standards and netstandard2.0 rules
The code now computes and reports method coverage alongside line and branch coverage. It introduces overall and per-module method coverage metrics using CoverageSummary.CalculateMethodCoverage, and includes these in the TestCoverageMessage output. Method coverage is now always calculated and reported, independent of threshold configuration.
Bertk
marked this pull request as ready for review
September 7, 2026 09:41
Bertk
force-pushed
the
failure-thresholds-mtp
branch
from
September 7, 2026 17:38
7758e96 to
80f23af
Compare
Bertk
force-pushed
the
failure-thresholds-mtp
branch
4 times, most recently
from
September 8, 2026 15:30
0665186 to
a4c5900
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
coverlet.core(also used forcoverlet.console,coverlet.msbuild)