From c49547d26fcea5fa5de4b308f396844d5f65f893 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 1 Jul 2026 23:45:11 +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> --- src/PoshGram.build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PoshGram.build.ps1 b/src/PoshGram.build.ps1 index c421fb3..07953a4 100644 --- a/src/PoshGram.build.ps1 +++ b/src/PoshGram.build.ps1 @@ -283,7 +283,7 @@ Add-BuildTask Test { } } - $numberFails = $testResults.FailedCount + $numberFails = ($testResults.FailedCount + $testResults.FailedBlocksCount + $testResults.FailedContainersCount) Assert-Build($numberFails -eq 0) ('Failed "{0}" unit tests.' -f $numberFails) Write-Build Gray (' ...CODE COVERAGE - CommandsExecutedCount: {0}' -f $testResults.CodeCoverage.CommandsExecutedCount) @@ -528,7 +528,7 @@ Add-BuildTask IntegrationTest { } } - $numberFails = $testResults.FailedCount + $numberFails = ($testResults.FailedCount + $testResults.FailedBlocksCount + $testResults.FailedContainersCount) Assert-Build($numberFails -eq 0) ('Failed "{0}" unit tests.' -f $numberFails) Write-Build Green ' ...Pester Integration Tests Complete!' }