Skip to content

fix audit findings: stale test counts, redundant guard, finally cleanup#27

Merged
MaceWindu merged 1 commit into
masterfrom
chore/audit-fixes
May 18, 2026
Merged

fix audit findings: stale test counts, redundant guard, finally cleanup#27
MaceWindu merged 1 commit into
masterfrom
chore/audit-fixes

Conversation

@MaceWindu
Copy link
Copy Markdown
Owner

Summary

  • Refresh stale Pester It-block counts in docs/testing.md (distro 46 → 68, totals 419 → 441 auto, 423 → 445 suite) to match the current test files.
  • Drop redundant truthy guard on $ProfileSpec.projects in modules/Prune.psm1 — the @(...) wrap on the following foreach already handles null/empty/single-element unwrap (gotcha Add wt tab color + dashboard/license polish #2).
  • Convert AfterAll cleanup in tests/distro/Prune.Tests.ps1 from try/catch {} to try/finally, per CLAUDE.md "cleanup belongs in finally". The -AllowFail flag 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
  • CI distro lane green (will land on PR)

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings May 18, 2026 01:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 catch cleanup to finally cleanup.

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.

@MaceWindu MaceWindu merged commit adf1b71 into master May 18, 2026
9 checks passed
@MaceWindu MaceWindu deleted the chore/audit-fixes branch May 18, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants