From 3e9e11aecb94b4ecda78b850901ffe4633cdabac Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 1 Jul 2026 23:44:39 +0200 Subject: [PATCH] Also fail on Pester block/container failures, not just failed tests In Pester 5 a run has three independent failure counts. Gating only on FailedCount misses FailedBlocksCount (BeforeAll/AfterAll) and FailedContainersCount (files that fail to discover/load), so a failing BeforeAll or an unloadable test file passes the build green. This adds those counts to the gate. Generated with AI (GitHub Copilot CLI). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 1b220f1..26576d6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -176,7 +176,7 @@ if (!$SkipTests) { $testResult = Invoke-Pester ./Tests/*.Tests.ps1 -Output Normal -PassThru Write-Host "" - if ($testResult.FailedCount -eq 0) { + if (($testResult.FailedCount + $testResult.FailedBlocksCount + $testResult.FailedContainersCount) -eq 0) { Write-Host "✓ All $($testResult.PassedCount) tests passed" -ForegroundColor Green } else { Write-Host "✗ $($testResult.FailedCount) tests failed" -ForegroundColor Red