chore: Track code coverage of the built module in the Pester task#140
Open
tablackburn wants to merge 2 commits into
Open
chore: Track code coverage of the built module in the Pester task#140tablackburn wants to merge 2 commits into
tablackburn wants to merge 2 commits into
Conversation
Enable Pester code coverage over the built module output, write a JaCoCo report to tests/out/coverage.xml, and print a one-line summary in the task output so the number is visible in every CI log. Tracking only - no threshold gate: the number understates real coverage because tests that exercise code in child processes (the build.tests.ps1 child builds and the Test-PSBuildPester subprocess matrix) are invisible to session instrumentation. Publishing the report from CI is #139. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
There was a problem hiding this comment.
Pull request overview
Enables Pester 6 code coverage tracking for the repository’s Pester psake task by instrumenting the built module output and emitting a JaCoCo coverage report alongside the existing NUnit test results.
Changes:
- Turn on Pester code coverage for
$settings.ModuleOutDirand write JaCoCo output totests/out/coverage.xml. - Print a one-line coverage summary in the
Pestertask output afterInvoke-Pestercompletes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback on #140: the argument list relied on comma binding tighter than -f, with a grouping paren that closed after the first argument. The output was correct, but the code read as if only one argument were grouped. Group all three arguments explicitly. Verified: coverage summary line prints identically (391 tests passed). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
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.
Summary
tests/out/coverage.xmland print a one-line summary in the task output, so the coverage number is visible in every CI logbuild.tests.ps1child builds and theTest-PSBuildPestersubprocess matrix from test: Add Test-PSBuildPester integration tests and fix latent bugs #137) are invisible to session instrumentation. It's a trend line for the Additional Pester tests needed #17 test batch, not an absolutepsake/.githubworkflow — tracked separately as CI: Publish the repository's code coverage results #139. The threshold-math bug in the shippedTest-PSBuildPestercoverage feature, found while evaluating this, is Test-PSBuildPester coverage threshold math truncates every percentage to zero #138No changelog entry: repository-internal change only.
Test Plan
./build.ps1 -Task Testlocally: 391 passed, 0 failed; summary line prints (Code coverage: 4.2 % of analyzed commands executed (44 of 1044)) andtests/out/coverage.xmlis produced (valid JaCoCo)Breaking Changes
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
Generated by Claude Code