Skip to content

chore: Pin Pester 6.0.0 for the repository test suite#132

Merged
tablackburn merged 4 commits into
mainfrom
claude/psake-project-next-item-6mfurr
Jul 7, 2026
Merged

chore: Pin Pester 6.0.0 for the repository test suite#132
tablackburn merged 4 commits into
mainfrom
claude/psake-project-next-item-6mfurr

Conversation

@tablackburn

@tablackburn tablackburn commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move this repository's own test suite from Pester 5.8.0 to 6.0.0, pinned exactly in requirements.psd1 (the targeting decision and its guardrails are recorded on Additional Pester tests needed #17)
  • Fix the one Pester 6 incompatibility in the existing suite: Pester 6 fails discovery on an empty -ForEach collection instead of silently generating nothing, which killed the whole tests/Help.tests.ps1 container because Build-PSBuildMAMLHelp has no related help links. The three data-driven blocks (help links, command parameters, help parameter names) are now guarded with discovery-time if checks that preserve the Pester 5 behavior and remain valid on both versions
  • Per review feedback: compute $helpParameters/$helpParameterNames during discovery so the help-parameter Context actually generates tests (it had never produced any — the variables were only assigned at run time), and fix the undefined $parameterNames reference inside it. Reactivating the block added 66 passing assertions
  • Update the repository testing instructions to match

This is a development-dependency change only, so there is no changelog entry (changelog is reserved for user-facing changes to the shipped module). The shipped module's Pester compatibility contract is untouched: Test-PSBuildPester still imports Pester with a 5.0.0 minimum and the manifest still declares Pester 5.x support.

Noteworthy: before the guard fix, the dead Help.tests.ps1 container was reported by Pester (Container failed: 1) but the build still exited 0 and psake reported success — a live occurrence of the failure-gate gap fixed in #128 (repo build file) and #133 (shipped function).

Test Plan

  • ./build.ps1 -Bootstrap -Task Test installs Pester 6.0.0 via PSDepend and runs green locally (Linux, PowerShell 7.6): 367 passed, 0 failed, 15 skipped (Windows-only signing tests), no failed containers
  • Before the Help.tests.ps1 fixes the same run reported 59 passed + 1 failed container, confirming the guards unlocked the per-command help tests rather than skipping them
  • CI matrix green (ubuntu / windows pwsh / windows PowerShell 5.1 / macOS): 382 tests, 0 failed

Breaking Changes

None for module consumers. Contributors running this repo's test suite will get Pester 6.0.0 installed by ./build.ps1 -Bootstrap.

🤖 Generated with Claude Code

https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa

Move the repository's own test suite from Pester 5.8.0 to 6.0.0, pinned
exactly in requirements.psd1 (#17 records the
targeting decision). This is a development-dependency change only: the
shipped module's Pester compatibility contract (Test-PSBuildPester
imports Pester with a 5.0.0 minimum) is unchanged.

Pester 6 fails discovery on an empty -ForEach collection instead of
silently generating nothing, which broke tests/Help.tests.ps1 for
commands whose help has no related links. Guard the three data-driven
blocks (help links, command parameters, help parameter names) with
discovery-time if checks, preserving the Pester 5 behavior on both
versions. Full suite passes under 6.0.0: 301 passed, 0 failed, 15
skipped (Windows-only signing tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa

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.

Pull request overview

This PR updates the repository’s development/test tooling to run the repo’s Pester test suite on a pinned Pester 6.0.0, and adjusts the help validation tests to avoid Pester 6 discovery failures when data-driven inputs are empty.

Changes:

  • Pin repository test dependency from Pester 5.8.0 to 6.0.0 in requirements.psd1.
  • Add discovery-time guards to data-driven blocks in tests/Help.tests.ps1 intended to preserve Pester 5 behavior when -ForEach inputs are empty.
  • Update contributor/testing documentation and CHANGELOG.md to reflect the pinned Pester 6.0.0 decision.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/Help.tests.ps1 Adds discovery-time guards around data-driven help tests to avoid Pester 6 empty-collection discovery failures.
requirements.psd1 Pins Pester dependency to 6.0.0 for the repository’s build/test bootstrap.
instructions/repository-specific.instructions.md Updates testing guidance to reflect Pester 6.0.0 and assertion-style expectations.
CHANGELOG.md Records the dependency targeting change under Unreleased.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Help.tests.ps1
Comment thread tests/Help.tests.ps1
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Test Results

    4 files  ±  0    640 suites  +264   23s ⏱️ +3s
  382 tests + 66    380 ✅ + 66   2 💤 ±0  0 ❌ ±0 
1 528 runs  +264  1 481 ✅ +264  47 💤 ±0  0 ❌ ±0 

Results for commit 85bbd11. ± Comparison against base commit efebfa4.

♻️ This comment has been updated with latest results.

claude added 3 commits July 7, 2026 20:52
Address review feedback on #132: the "help parameter in code" Context
consumed $helpParameterNames at discovery time, but the variable was
only assigned in BeforeAll (run phase), so the block never generated
any tests under Pester 5 or 6. Compute $helpParameters and
$helpParameterNames in BeforeDiscovery, matching the other data-driven
blocks. Also fix the assertion inside it, which referenced the
undefined $parameterNames instead of $commandParameterNames - a latent
bug that never surfaced because the block never ran.

Reactivating the block adds 66 assertions: 367 passed, 0 failed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
The changelog documents user-facing changes to the shipped module;
which Pester version this repository's own test suite runs on is a
contributor-facing concern and is already covered by the repository
instructions and #17.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
CHANGELOG.md documents user-facing changes to the shipped module only;
repository-internal changes (dev dependencies, CI, repo build scripts,
test suite) get no entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011semwa5HU1BUKKL4RoWjKa
@tablackburn tablackburn merged commit 55a4792 into main Jul 7, 2026
9 checks passed
@tablackburn tablackburn deleted the claude/psake-project-next-item-6mfurr branch July 7, 2026 22:22
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.

3 participants