Skip to content

build(test): pin Pester at 6.1.0 through tests/Run-Tests.ps1; CI reads the pin from it - #54

Merged
bilbospocketses merged 1 commit into
mainfrom
pin/pester-6.1.0
Sep 3, 2026
Merged

bilbospocketses merged 1 commit into
mainfrom
pin/pester-6.1.0

Conversation

@bilbospocketses

Copy link
Copy Markdown
Owner

What

  • tests/Run-Tests.ps1 now owns the Pester version on a -PesterVersion parameter tagged PESTER_PIN, pinned at 6.1.0 (was a #Requires line capping below 6.x "until validated"; the suite is validated on 6.1.0 now, 527/527). It re-launches itself in a fresh pwsh -NoProfile -NonInteractive (an already-loaded Pester otherwise wins silently over -RequiredVersion), keeps -Tag / -ExcludeTag, keeps the v1.0.10 [System.Environment]::Exit exit-code contract, fails when Pester returns no result object, and fails when nothing passed (a filter that matches nothing still reports every discovered test in TotalCount and calls the run Passed, so a typo'd -Tag would otherwise exit 0).
  • ci.yml and release.yml read the pin from that line and Install-Module exactly 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 through Run-Tests.ps1) stands.
  • CONTRIBUTING prerequisites and the runner note, README "Running tests", CHANGELOG [Unreleased].

Verified locally (after dotnet restore, as CI does)

pwsh -NoProfile -File tests/Run-Tests.ps1                 -> Pester 6.1.0: 527 passed, 0 failed, 0 skipped, 527 total; exit 0
pwsh -NoProfile -File tests/Run-Tests.ps1 -Tag NoSuchTag  -> 0 passed of 527 discovered; exit 1

…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.
@bilbospocketses
bilbospocketses merged commit 53a4546 into main Sep 3, 2026
6 checks passed
@bilbospocketses
bilbospocketses deleted the pin/pester-6.1.0 branch September 3, 2026 16:28
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.

1 participant