Skip to content

Pester 6.0.0-rc pilot: compatibility signal across 15 real-world v5 repos #2795

Description

@nohwnd

Why

To gauge how feasible the v5→v6 migration is and get early CI feedback before 6.0.0 final, we opened [DO NOT MERGE] draft PRs pinning ~15 real-world Pester-v5 consumer repos to 6.0.0-rc1/rc2. Each is throwaway (suggested not to merge); the goal was to surface breaks against real suites. This is the aggregated signal.

Overall: 🟢 feasible

Nearly every break is a documented change with a mechanical fix. The only undocumented behavior change found (Should -HaveCount counting dictionary entries) was caught and reverted pre-release. No undocumented break survives. One repo (maester) had a CI cancellation that is not a Pester regression (could not reproduce on rc2).

Pilot PRs

Repo PR Signal
dsccommunity/SqlServerDsc #2464 🟢 green on v6 (after fixes)
dsccommunity/ComputerManagementDsc #467 🟢 green on v6 (after fixes)
dsccommunity/ActiveDirectoryDsc #751 🟢 unit green (HQRM red = PSSA, not Pester)
dsccommunity/NetworkingDsc #545 🟢 unit green
dataplat/dbachecks #1038 🟢 Linux/Package; Windows pending
Badgerati/Pode #1732 🟡 documented breaks only
dataplat/dbatools #10405 🟡 documented breaks only
chocolatey/choco #3917 🟢 / awaiting approval
chocolatey/cChoco #194 awaiting CI
Windos/BurntToast #293 awaiting approval
techthoughts2/Catesta #108 awaiting approval
PowerShell/PSScriptAnalyzer #2191 awaiting approval (CLA ok)
maester365/maester #1884 ⚪ inconclusive — not Pester (see below)
igoravl/TfsCmdlets #281 ⚪ not Pester (missing fork secrets)
gaelcolas/Sampler #577 ⚪ Azure didn't trigger
PowerShell/PowerShellEditorServices skipped (no live Pester CI path)

Breaking-change tally (consumer test changes needed)

Change Documented Hits Fix
Mock -ParameterFilter no-match throws (no fall-through to real cmd) yes 41 add a default Mock, or forward: Mock X { & (Get-Command X -CommandType Cmdlet) @PesterBoundParameters }
Should -HaveCount counts dict entries no → reverted 40 n/a (reverted in #2783)
Assert-MockCalled removed yes 8 Should -Invoke
Assert-VerifiableMock removed yes 3 Should -InvokeVerifiable
Duplicate AfterAll throws yes 2 merge blocks
-ForEach $null/@() throws yes 2 -AllowNullOrEmptyForEach / guard

Lessons

  • Mock fall-through removal is the dominant break (41 hits). It's the only change that needs case-by-case work; everything else is mechanical search/replace. Worth highlighting prominently in the migration guide.
  • The mechanical breaks (Assert-MockCalled, Assert-VerifiableMock, -ForEach @(), duplicate AfterAll) were trivial to fix and behaved exactly as documented — no surprises.
  • One undocumented behavior change slipped in: Should -HaveCount started counting a piped dictionary's entries instead of treating it as one object. The pilot caught it (top breakage bucket) and it was reverted before release.
  • maester (CC using Measure-Script #1884): rc1 CI jobs were cancelled at ~3h vs <2min on v5, which looked like a perf regression. Reproduced locally on rc2: full suite finishes in minutes, the 408-file PSScriptAnalyzer.Tests.ps1 runs 661 tests in ~6s with no super-linear discovery cost. Not a Pester regression — likely an env hang (Graph/coverage) or a kill of a queued run. Needs a maintainer re-run on rc2.

Bottom line

Migration is feasible. Breaks are documented and mostly mechanical; the single doc-gap was found and reverted. Suggested follow-ups: emphasize Mock fall-through removal in migration docs, and re-run maester on rc2 to confirm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions