From bd147c1d8ab0288ab2f84b6262facfe9e5e8a328 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 8 Mar 2018 11:12:00 -0800 Subject: [PATCH 1/4] rethrow errors so that appveyor will fail --- tools/appveyor.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 2ac4f0b0176..1d19cf4a88d 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -555,6 +555,7 @@ function Invoke-AppveyorFinish } catch { Write-Host -Foreground Red $_ + throw $_ } finally { # A throw statement would not make the build fail. This function is AppVeyor specific From a241dca5aec07c0455967ea74a7ce31ead7680fd Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 8 Mar 2018 11:12:20 -0800 Subject: [PATCH 2/4] [Package] Write warning when pushing file fragment fails --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 7c4a9ad4da8..06dedfd2d19 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -2286,7 +2286,7 @@ function Test-FileWxs } catch { - #ignore any error pushing the artifact + Write-Warning -Message "Pushing MSI File fragment failed." } } From 19e5aa8b53dc06b3bb6ec14be776d7d365dbab30 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 8 Mar 2018 12:12:03 -0800 Subject: [PATCH 3/4] remove unused code --- tools/appveyor.psm1 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 1d19cf4a88d..7712541f0bd 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -446,7 +446,6 @@ function Get-ReleaseTag # Implements AppVeyor 'on_finish' step function Invoke-AppveyorFinish { - $exitCode = 0 try { $releaseTag = Get-ReleaseTag @@ -557,13 +556,4 @@ function Invoke-AppveyorFinish Write-Host -Foreground Red $_ throw $_ } - finally { - # A throw statement would not make the build fail. This function is AppVeyor specific - # and is the only command executed in 'on_finish' phase, so it's safe that we request - # the current runspace to exit with the specified exit code. If the exit code is non-zero, - # AppVeyor will fail the build. - # See this link for details: - # https://help.appveyor.com/discussions/problems/4498-powershell-exception-in-test_script-does-not-fail-build - $host.SetShouldExit($exitCode) - } } From 9b6c3375d01499dee47123d47fd039d0f64c8f01 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Thu, 8 Mar 2018 12:40:09 -0800 Subject: [PATCH 4/4] [package] rename log commands --- tools/appveyor.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 7712541f0bd..6cccb6fedc3 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -489,7 +489,7 @@ function Invoke-AppveyorFinish } # Smoke Test MSI installer - log "Smoke-Testing MSI installer" + Write-Log "Smoke-Testing MSI installer" $msi = $artifacts | Where-Object { $_.EndsWith(".msi")} $msiLog = Join-Path (Get-Location) 'msilog.txt' $msiExecProcess = Start-Process msiexec.exe -Wait -ArgumentList "/I $msi /quiet /l*vx $msiLog" -NoNewWindow -PassThru @@ -500,7 +500,7 @@ function Invoke-AppveyorFinish throw "MSI installer failed and returned error code $exitCode. MSI Log was uploaded as artifact." } - log "MSI smoke test was successful" + Write-Log "MSI smoke test was successful" # only publish assembly nuget packages if it is a daily build and tests passed if((Test-DailyBuild) -and $env:TestPassed -eq 'True')