From 2bf83314ddf1bb7f4cf06f0727b13d4be3272797 Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Thu, 11 Dec 2025 08:47:47 -0800 Subject: [PATCH] (#107) Honor Pester ExitCode Pester always sets `$LASTEXITCODE`, so there is no need to manually set it to the number of failed tests. Further, in the event of a container failure, the number of failed tests could be 0 when the failure occurs before enumeration of the tests. Additionally, this exit code doesn't actually help as test-kitchen does not display the exit code, and itself exits with 20. --- lib/kitchen/verifier/pester.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/kitchen/verifier/pester.rb b/lib/kitchen/verifier/pester.rb index 3884525..277e501 100644 --- a/lib/kitchen/verifier/pester.rb +++ b/lib/kitchen/verifier/pester.rb @@ -311,7 +311,6 @@ def invoke_pester_scriptblock $result | Export-CliXml -Path } - $LASTEXITCODE = $result.FailedCount $host.SetShouldExit($LASTEXITCODE) exit $LASTEXITCODE