Test Result Analyzer fails if no stack trace is available - #2257
Test Result Analyzer fails if no stack trace is available#2257FreundDK wants to merge 21 commits into
Conversation
Dependencies
There was a problem hiding this comment.
Pull request overview
Fixes a crash in the AnalyzeTests action when a <failure> XML element has no stack trace content by switching from the XML "#text" accessor (which can be $null) to InnerText (empty string for empty nodes).
Changes:
- Replace
$failure."#text"with$failure.InnerTextwhen rendering and storing stack traces inGetTestResultSummaryMD.
aholstrup1
left a comment
There was a problem hiding this comment.
LGTM. Missing a releasenote though
|
@aholstrup1 - any chance we can get this small bugfix in? |
|
Of course @freddydk - Sorry about the wait :) We just shipped v9.1. Can I get you to update the release note in this PR? Once it's updated we'll get it merged |
Done |
|
@FreundDK Looks like there is a merge conflict somewhere (I'm guessing in the releasenotes) 🙃 |
Head branch was pushed to by a user without write access
Resolved, please approve and merge |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
Actions/AnalyzeTests/TestResultAnalyzer.ps1:195
- Please add a Pester regression test that passes a failing test case with an empty
<failure>element toGetTestResultSummaryMDand verifies that analysis completes with an empty stack trace. The current suite tests other analyzer functions but never exercises this function, so this exact bug could regress unnoticed.
Write-Host " $($failure.InnerText.Trim().Replace("`n","`n "))"
❔What, Why & How
Fixes #2256
TestResultAnalyzer uses "#Text", which might be null instead of InnerText
This code shows what is wrong with that: