Skip the document-level coverage thresholds on a SearchRoot-scoped coverage runner run - #938
Merged
drmoisan merged 12 commits intoSep 29, 2026
Merged
Conversation
…lan for scoped coverage threshold and runner formatting Adds the promoted record, issue.md with a derived Acceptance Criteria section, and the atomic plan that cleared executor preflight in round 4. Preparation only for run bugs-2026-09-28. Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…ius extraction does not record them as writes Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…k-offs Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
…plan check-offs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
…chRoot-scoped runner run Adds Test-CoverageRunIsScoped in a new part file, gates the two threshold assertions in Invoke-MSTestWithCoverageMain behind it with one warning, documents SearchRoot scoping in comment-based help, and adds 14 Pester tests. The unscoped run keeps both assertions unchanged. Records Phase 1 evidence P1-T1 to P1-T7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
…off, AC6 open on changed-line coverage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
…le 1 (AC6 changed-line coverage) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
…art file so every changed line is credited Adds Assert-CoberturaCoverageThresholdForRun to Invoke-MSTestWithCoverage.Scope.ps1; the entry point makes one unconditional call. Test-CoverageRunIsScoped now rejects empty and relative paths. Adds 8 Pester tests (22 in the suite). Full-population Pester line coverage 94.53 percent against the 94.49 baseline, with no uncovered changed line. AC6 checked off. Records remediation cycle 1 evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
…coped-threshold-and-format-928
…-and-format-928 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm
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.
Suggested title
Skip the document-level coverage thresholds on a SearchRoot-scoped coverage runner run
Summary
-SearchRootto a directory other than the repository root now skips the two document-level threshold assertions (80 percent line, 75 percent branch) and writes exactly one warning naming the skip and the scoped search root.-SearchRoot,-SearchRoot ., or-SearchRoot .\) is unchanged: both assertions still run, in the same order, with the same 80 and 75 literals and messages inInvoke-MSTestWithCoverage.Threshold.ps1.Invoke-MSTestWithCoverageMain.Why
The threshold gate was designed for whole-solution runs.
-SearchRootnarrows the executed tests without narrowing the coverage denominator, so a single-assembly run failed the solution-wide floors on a healthy tree. Tracked as issue 928, which consolidates the earlier scoped-threshold report and the formatting residual left by the Dependabot repair work.What Changed
Core behavior
scripts/vscode/Invoke-MSTestWithCoverage.Scope.ps1(new, 104 lines):Test-CoverageRunIsScoped: a pure predicate. It compares the full paths of the resolved search root and the repository root, ordinal case-insensitive, with trailing separators ignored. It rejects empty and relative inputs.Assert-CoberturaCoverageThresholdForRun: writes one warning and returns on a scoped run; otherwise it runs the two existing threshold assertions unchanged and in order.scripts/vscode/Invoke-MSTestWithCoverage.ps1: dot-sources the new part file, replaces the two unconditional assertion calls with one unconditional call toAssert-CoberturaCoverageThresholdForRun, and adds.DESCRIPTIONand.PARAMETER SearchRoothelp (+24/-2).Tests
tests/scripts/vscode/Invoke-MSTestWithCoverage.Scope.Tests.ps1(new, 22 tests):TestDrive. Every filesystem command is mocked, and the real threshold assertions and the real collection wrapper run.Docs and evidence
evidence/. Committed evidence carries derived figures only, with<repo-root>placeholders.Architecture / How It Fits Together
Invoke-MSTestWithCoverageMainresolves the repository root and the search root, collects and post-processes coverage, and then callsAssert-CoberturaCoverageThresholdForRun. That call is the single decision point.The gate lives in the path-loaded part file rather than in the entry point for a coverage reason. Pester breakpoint coverage credits an entry-point line only from the first test file that parses its own copy of the entry point, so a scoped-arm line written in the entry point was reported as uncovered even though a test executed it. Lines in a part file loaded by path are credited from any test file. The first review cycle found this, and remediation cycle 1 moved the gate.
Verification
Completed (from the committed evidence in the feature folder):
scripts/vscodeandtests/scripts/vscodeproduced identical raw-byte hashes before and after. A liveness control confirmed that the formatter rewrites a deliberately mis-indented line.scripts/vscodefolder total is unchanged at 13, andInvoke-MSTest.ps1is unchanged at 2 pre-existing, deliberately retainedWrite-Hostfindings.tests/scripts/dependenciesandtests/scripts/vscode) passed 342 of 342, with 0 failures..github/workflows/_pester.yml(breakpoint mode, coverage overscripts/dependenciesandscripts/vscode):Recommended:
scripts/vscode/Invoke-MSTestWithCoverage.ps1 -SearchRoot <test project folder>. It should complete with one "Coverage threshold assertions skipped" warning.-SearchRoot .should still enforce the floors.Backward Compatibility / Migration Notes
-SearchRoot ., which is unscoped, so their behavior is unchanged.Risks and Mitigations
Review Guide
scripts/vscode/Invoke-MSTestWithCoverage.Scope.ps1: the predicate and the gate function.scripts/vscode/Invoke-MSTestWithCoverage.ps1: the dot-source, the single call, and the help text.tests/scripts/vscode/Invoke-MSTestWithCoverage.Scope.Tests.ps1.Follow-ups
Recorded in the reaudit artifacts as candidates, not changed here:
.claudeand.codextrees.GitHub Auto-close
🤖 Generated with Claude Code
https://claude.ai/code/session_01KNZiXntshsLY8vqqCHUvHm