ci: print a failed-test summary at the end of the Pester run - #115
Merged
Merged
Conversation
Pester's own console output already shows each failure inline as it happens, but nothing at the very end lists which tests failed without scrolling back through a (sometimes 1000+ line) log. Adds a short "FAILED TESTS" block after the run, listing each failed test's full Describe/It path and error message. This meant switching Run.Exit from $true to $false and calling exit manually with the failure count, since Invoke-Pester's own Run.Exit handling calls exit internally and would skip the summary entirely. Verified both the failing and all-passing paths locally: the summary prints and the exit code is correct in both cases. Also fixed a real, separately-discovered issue while touching this file: the "Ensure Pester 5 is available" step only checked "-ge 5.0.0", which would silently accept a newer major version like 6.x if one happened to already be installed on the agent - which is exactly what was found installed on the shared self-hosted agent (v6.2.0, whose result-object shape can't be assumed compatible with 5.x, the version this whole pipeline's Pester-specific code actually targets). Both the install check and Import-Module now pin to the 5.x range specifically. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pester's own console output shows each failure inline as it happens, but nothing at the very end lists which tests failed without scrolling back through a (sometimes 1000+ line) log. Adds a short "FAILED TESTS" block right after the run, listing each failed test's full
Describe/Itpath and error message - e.g.:This meant switching
Run.Exitfrom$trueto$falseand callingexitmanually with the failure count afterward, sinceInvoke-Pester's ownRun.Exithandling callsexitinternally and would skip the summary entirely.Also fixed a real, separately-discovered issue while touching this file: the "Ensure Pester 5 is available" step only checked
-ge 5.0.0, which would silently accept a newer major version like 6.x if one happened to already be installed on the agent - which is exactly what was found installed on the shared self-hosted agent (v6.2.0, whose result-object shape can't be assumed compatible with 5.x, the version this whole pipeline's Pester-specific code actually targets, including the new summary logic). Both the install check andImport-Modulenow pin to the 5.x range specifically.Test plan
🤖 Generated with Claude Code