Skip to content

Commit

Permalink
publish-test-results.yml: Check for [ERROR] in RunInfo rather than St…
Browse files Browse the repository at this point in the history
…dOut
  • Loading branch information
NightOwl888 committed Jan 8, 2025
1 parent ca3e91e commit 7daee81
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .build/azure-templates/publish-test-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ steps:
$reader = [System.Xml.XmlReader]::Create($testResultsFileName)
try {
$countersFound = $false
$stdOutFound = $false
$crashed = $false
$inRunInfos = $false
while ($reader.Read()) {
Expand All @@ -70,17 +69,6 @@ steps:
Write-Host "##vso[task.setvariable variable=TotalFailures;]$totalFailures"
$countersFound = $true
}
if (!$stdOutFound -and $reader.Name -eq 'StdOut') {
# Test for specific error messages - we may need to adjust this, as needed
$innerXml = $reader.ReadInnerXml()
if ($innerXml -and ($innerXml.Contains('[ERROR]'))) {
Write-Host "##vso[task.setvariable variable=StdOutFailure;]true"
# Report all of the test projects that had stdout failures
$stdOutFailureRuns = "$env:STDOUTFAILURERUNS,$testProjectName".TrimStart(',')
Write-Host "##vso[task.setvariable variable=StdOutFailureRuns;]$stdOutFailureRuns"
}
$countersFound = $true
}
# Report a crash of the test runner
if ($reader.Name -eq 'RunInfos') {
$inRunInfos = $true
Expand All @@ -99,6 +87,13 @@ steps:
Write-Host "##vso[task.setvariable variable=CrashedRuns;]$crashedRuns"
$crashed = $true
}
if ($innerXml -and ($innerXml.Contains('[ERROR]'))) {
Write-Host "##vso[task.setvariable variable=StdOutFailure;]true"
# Report all of the test projects that had stdout failures
$stdOutFailureRuns = "$env:STDOUTFAILURERUNS,$testProjectName".TrimStart(',')
Write-Host "##vso[task.setvariable variable=StdOutFailureRuns;]$stdOutFailureRuns"
$crashed = $true
}
}
}
if ($reader.NodeType -eq [System.Xml.XmlNodeType]::EndElement -and $reader.Name -eq 'RunInfos') {
Expand Down

0 comments on commit 7daee81

Please sign in to comment.