Repository navigation
Description
Add Pester 6 integration tests for Test-PSBuildPester.
Scenarios to cover:
- Invokes Pester against a fixture test file and returns a result object
- Correctly signals failure when tests fail (regression: Changes $configuration.Run.PassThru to $True #52)
- Failures in
BeforeAll/AfterAllblocks and container/discovery errors also fail the build, not just failedIttests (see Also fail on Pester block/container failures (not just failed tests) #128) - Code coverage output path and format are respected (regression: Addressing Issue #61 - update CodeCoverage Output File Format to fix error #62)
- Depends on shared fixture module (see Tests: Create shared fixture module #97)
Scope note: the block/container-failure scenario fails against current code — Test-PSBuildPester.ps1 gates only on FailedCount. The fix (include FailedBlocksCount and FailedContainersCount in the gate, mirroring #128's change to the repo's own psakeFile.ps1) is in scope for the same PR as these tests, so the PR merges green. If #128 is extended to cover the shipped function first, this PR only contributes the regression test.
Implementation note: these tests are Pester-testing-Pester, and two Pester versions cannot coexist in one session. Run the inner Invoke-Pester in a subprocess (Start-Job, as tests/build.tests.ps1 already does) so the inner Pester version is independent of the outer test framework. Then parameterize the inner run across both Pester 5.x and 6.x — the shipped function keeps supporting Pester 5 consumers, and this matrix is what verifies that contract.
Target Pester 6.0.0 (outer framework) with classic Should syntax — see notes on #17. Parent issue: #17
Activity
tablackburn commentedon Jul 7, 2026
Decision (2026-07-07): The sub-issue bodies under #17 previously said "use Pester 5 syntax." They have been updated to target Pester 6.0.0, which was released as stable today; Pester 5 simultaneously moved to maintenance mode (critical/security fixes only).
Rationale and guardrails:
tests/). The shipped module's compatibility contract —Test-PSBuildPesterimporting Pester with-MinimumVersion 5.0.0and the manifest'sRequiredModulesfloor — is unchanged. Consumers on Pester 5 remain fully supported.6.0.0inrequirements.psd1(not a floating minimum) and bumped deliberately as 6.0.x patches land, since the release is brand new.Should -Beassertion syntax, which is valid in both Pester 5 and 6, rather than the newShould-*assertion family. This keeps every new file trivially backportable to Pester 5.9 if 6.0.0 proves too raw.Test-PSBuildPestertests are Pester-testing-Pester, so the innerInvoke-Pesterruns in a subprocess and is matrixed across Pester 5.x and 6.x to continuously verify the Pester 5 consumer contract. Details in that issue's body.No code has been started yet; this records the targeting decision before work begins on #97 (shared fixture module) and the rest of the batch.
Generated by Claude Code
test: Add Test-PSBuildPester integration tests and fix latent bugs