Skip to content

Commit fd75bbd

Browse files
authored
Test-Packages.ps1 - check $LastExitCode explicitly
1 parent 10564cc commit fd75bbd

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

eng/scripts/Test-Packages.ps1

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,31 @@ foreach ($package in $packagesToTest) {
5656

5757
Write-Host "`n`nTesting package: '$($package.Name)'`n"
5858

59-
Invoke-LoggedCommand "cargo build --keep-going" -GroupOutput
59+
# Temporary fix to exit immediately on failure. LogError should Write-Error
60+
# instead
61+
$command = "cargo build --keep-going"
62+
Invoke-LoggedCommand $command -GroupOutput
63+
if ($LastExitCode) {
64+
Write-Error "Failed to execute $command"
65+
}
6066
Write-Host "`n`n"
6167

62-
Invoke-LoggedCommand "cargo test --doc --no-fail-fast" -GroupOutput
68+
# Temporary fix to exit immediately on failure. LogError should Write-Error
69+
# instead
70+
$command = "cargo test --doc --no-fail-fast"
71+
Invoke-LoggedCommand $command -GroupOutput
72+
if ($LastExitCode) {
73+
Write-Error "Failed to execute $command"
74+
}
6375
Write-Host "`n`n"
6476

65-
Invoke-LoggedCommand "cargo test --all-targets --no-fail-fast" -GroupOutput
77+
# Temporary fix to exit immediately on failure. LogError should Write-Error
78+
# instead
79+
$command = "cargo test --all-targets --no-fail-fast"
80+
Invoke-LoggedCommand $command -GroupOutput
81+
if ($LastExitCode) {
82+
Write-Error "Failed to execute $command"
83+
}
6684
Write-Host "`n`n"
6785

6886
$cleanupScript = Join-Path $packageDirectory "Test-Cleanup.ps1"

0 commit comments

Comments
 (0)