Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ci: fail on test failures
PowerShell can _read_ top-level variables in functions, but cannot _update_
top-level variables in functions unless they're explicitly prefixed with
`$global`.
  • Loading branch information
ethomson committed Oct 25, 2018
commit 0e26717a57169d1222bdebef3f0caa728fd85b75
6 changes: 3 additions & 3 deletions ci/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $PSDefaultParameterValues['*:ErrorAction'] = 'Stop'

$SourceDir = Split-Path (Split-Path (Get-Variable MyInvocation).Value.MyCommand.Path)
$BuildDir = Get-Location
$Success = $true
$global:Success = $true

if ($Env:SKIP_TESTS) { exit }

Expand All @@ -25,7 +25,7 @@ function run_test {
Write-Host $TestCommand
Invoke-Expression $TestCommand

if ($LastExitCode -ne 0) { $Success = $false }
if ($LastExitCode -ne 0) { $global:Success = $false }
}

Write-Host "##############################################################################"
Expand Down Expand Up @@ -69,4 +69,4 @@ if (-not $Env:SKIP_PROXY_TESTS) {
taskkill /F /IM javaw.exe
}

if (-not $Success) { exit 1 }
if (-Not $global:Success) { exit 1 }