build(test): pin Pester at 6.1.0 through tests/Run-Tests.ps1; CI reads the pin from it - #54
Merged
Merged
Conversation
…s the pin from it The pin moves from the #Requires line (5.3.1 <= Pester < 6, capped below 6.x "until validated") to a -PesterVersion parameter tagged PESTER_PIN, the only place the version lives. ci.yml and release.yml read it from there and Install-Module exactly that version before running the script, so the runner image's Pester no longer decides what runs. The suite is validated on 6.1.0: 527/527. Run-Tests.ps1 re-launches itself in a fresh pwsh -NoProfile -NonInteractive so an already-loaded Pester cannot win over -RequiredVersion, keeps -Tag / -ExcludeTag (passed through the child as comma-joined strings), keeps the v1.0.10 [System.Environment]::Exit exit-code contract, fails when Pester returns no result object, and fails when nothing passed: with a filter that matches nothing Pester still reports every discovered test in TotalCount and calls the run Passed, so a typo'd -Tag would otherwise exit 0. CONTRIBUTING, README and CHANGELOG updated. Verified locally on Pester 6.1.0 after dotnet restore: 527/527 via the runner (exit 0); -Tag NoSuchTag -> 0 passed of 527 discovered, exit 1.
This was referenced Sep 3, 2026
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.
What
tests/Run-Tests.ps1now owns the Pester version on a-PesterVersionparameter taggedPESTER_PIN, pinned at 6.1.0 (was a#Requiresline capping below 6.x "until validated"; the suite is validated on 6.1.0 now, 527/527). It re-launches itself in a freshpwsh -NoProfile -NonInteractive(an already-loaded Pester otherwise wins silently over-RequiredVersion), keeps-Tag/-ExcludeTag, keeps the v1.0.10[System.Environment]::Exitexit-code contract, fails when Pester returns no result object, and fails when nothing passed (a filter that matches nothing still reports every discovered test inTotalCountand calls the runPassed, so a typo'd-Tagwould otherwise exit 0).ci.ymlandrelease.ymlread the pin from that line andInstall-Moduleexactly that version before running the script, so the runner image's Pester no longer decides what runs. The v1.0.8 audit rule (always go throughRun-Tests.ps1) stands.[Unreleased].Verified locally (after
dotnet restore, as CI does)