From ce576460e2ec98f1b11f88675404f28f39622fd9 Mon Sep 17 00:00:00 2001 From: martincostello Date: Sat, 20 Jan 2024 12:43:29 +0000 Subject: [PATCH] Fix AoT test script false negatives - Script did not fail for errors, only warnings. - Script did not fail if publishing failed. --- build/test-aot-compatibility.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/test-aot-compatibility.ps1 b/build/test-aot-compatibility.ps1 index 09cf3c5ad4..821f4dc314 100644 --- a/build/test-aot-compatibility.ps1 +++ b/build/test-aot-compatibility.ps1 @@ -10,7 +10,7 @@ $actualWarningCount = 0 foreach ($line in $($publishOutput -split "`r`n")) { - if ($line -like "*analysis warning IL*") + if (($line -like "*analysis warning IL*") -or ($line -like "*analysis error IL*")) { Write-Host $line $actualWarningCount += 1 @@ -20,6 +20,11 @@ foreach ($line in $($publishOutput -split "`r`n")) Write-Host "Actual warning count is:", $actualWarningCount $expectedWarningCount = 0 +if ($LastExitCode -ne 0) +{ + Write-Host "There was an error while publishing AotCompatibility Test App. LastExitCode is:", $LastExitCode +} + pushd $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Release/$targetNetFramework/$runtime Write-Host "Executing test App..."