Fix coverage badge showing the wrong percentage; raise NetClean.psm1 … - #5
Merged
Conversation
…coverage The "Generate GitHub Pages coverage badge payload" step in ci.yml selected its LINE counter via a bare `//counter` XPath search, which matches every nested per-package/per-sourcefile/per-class/per-method counter in the JaCoCo report, then took the first LINE-type match in document order. That's whichever function happens to appear first in the report, not the overall total - confirmed live: the deployed badge read 46.43% against an actual ~96% overall. Fixed by selecting /report/counter[@type="LINE"], the report-level aggregate, and added a regression test asserting the fix stays in place. Also add 8 tests closing real coverage gaps in NetClean.psm1 found via the PR's changed-files coverage report (94.28%, below the 95% gate): Invoke-InParallel's single-input-item fast path (success and the failing case) had zero coverage, and Get-NetCleanDeviceManagementState was missing its three failure-warning branches (dsregcmd throwing outright, the domain fallback also failing, MDM task detection throwing) plus two join-type branches (Entra-only and Enterprise-only, as opposed to hybrid). NetClean.psm1 coverage: 94.28% -> 95.48%. Full suite: 496/496 passing, 95.87% overall coverage, 0 PSScriptAnalyzer findings.
NetClean Coverage Report
|
Owner
Author
|
Increased coverage of netclean.psm1 to be greater than 95% and fixed the README badges. |
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.
…coverage
The "Generate GitHub Pages coverage badge payload" step in ci.yml selected its LINE counter via a bare
//counterXPath search, which matches every nested per-package/per-sourcefile/per-class/per-method counter in the JaCoCo report, then took the first LINE-type match in document order. That's whichever function happens to appear first in the report, not the overall total - confirmed live: the deployed badge read 46.43% against an actual ~96% overall. Fixed by selecting /report/counter[@type="LINE"], the report-level aggregate, and added a regression test asserting the fix stays in place.Also add 8 tests closing real coverage gaps in NetClean.psm1 found via the PR's changed-files coverage report (94.28%, below the 95% gate): Invoke-InParallel's single-input-item fast path (success and the failing case) had zero coverage, and Get-NetCleanDeviceManagementState was missing its three failure-warning branches (dsregcmd throwing outright, the domain fallback also failing, MDM task detection throwing) plus two join-type branches (Entra-only and Enterprise-only, as opposed to hybrid). NetClean.psm1 coverage: 94.28% -> 95.48%.
Full suite: 496/496 passing, 95.87% overall coverage, 0 PSScriptAnalyzer findings.