fix audit findings: stale test counts, redundant guard, finally cleanup#27
Merged
Conversation
- docs/testing.md: refresh Pester It-block counts (distro 46 -> 68, totals 419 -> 441 auto, 423 -> 445 suite) to match current files. - modules/Prune.psm1: drop redundant truthy check on $ProfileSpec.projects; the @(...) wrap on the following foreach already handles null/empty/single-element unwrap (gotcha #2). - tests/distro/Prune.Tests.ps1: AfterAll cleanup moved from try/catch{} to try/finally per CLAUDE.md "cleanup belongs in finally". -AllowFail on the project-remove call already covers expected non-zero exits; surfacing unexpected exceptions is preferable to swallowing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses audit findings by refreshing testing documentation counts, simplifying prune profile enumeration, and making distro test cleanup surface unexpected teardown errors.
Changes:
- Updates documented Pester
It-block counts for pure/distro/manual totals. - Removes a redundant truthy guard before
@($ProfileSpec.projects)enumeration. - Converts prune distro test teardown from swallowed
catchcleanup tofinallycleanup.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
docs/testing.md |
Refreshes test count documentation. |
modules/Prune.psm1 |
Simplifies host project enumeration guard in stale worktree detection. |
tests/distro/Prune.Tests.ps1 |
Ensures cleanup runs in finally while allowing unexpected teardown exceptions to surface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
It-block counts indocs/testing.md(distro 46 → 68, totals 419 → 441 auto, 423 → 445 suite) to match the current test files.$ProfileSpec.projectsinmodules/Prune.psm1— the@(...)wrap on the followingforeachalready handles null/empty/single-element unwrap (gotcha Add wt tab color + dashboard/license polish #2).AfterAllcleanup intests/distro/Prune.Tests.ps1fromtry/catch {}totry/finally, per CLAUDE.md "cleanup belongs infinally". The-AllowFailflag on the project-remove call already covers expected non-zero exits; surfacing unexpected exceptions is preferable to swallowing them.All three came out of a whole-codebase audit run against
master.Test plan
.\test-claudearium.ps1 -ParseCheck— 74 files clean.\test-claudearium.ps1 -Auto -Only pure -CI— 373/373 passing locally🤖 Generated with Claude Code