Skip to content

Fix coverage badge showing the wrong percentage; raise NetClean.psm1 … - #5

Merged
scweeks merged 1 commit into
mainfrom
fix/coverage-badge-and-gap
Jul 27, 2026
Merged

Fix coverage badge showing the wrong percentage; raise NetClean.psm1 …#5
scweeks merged 1 commit into
mainfrom
fix/coverage-badge-and-gap

Conversation

@scweeks

@scweeks scweeks commented Jul 27, 2026

Copy link
Copy Markdown
Owner

…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.

…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.
Copilot AI review requested due to automatic review settings July 27, 2026 12:24
@scweeks scweeks self-assigned this Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@scweeks scweeks added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown

NetClean Coverage Report

Overall Project 95.87% 🍏

There is no coverage information present for the Files changed

@scweeks

scweeks commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

Increased coverage of netclean.psm1 to be greater than 95% and fixed the README badges.

@scweeks
scweeks merged commit 64d344e into main Jul 27, 2026
5 checks passed
@scweeks
scweeks deleted the fix/coverage-badge-and-gap branch July 27, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants