From 8233b5e332f62a3020823a0590033f640df0ff63 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 12 Aug 2016 12:35:46 -0700 Subject: [PATCH] Fix typo when getting Core build output location Fail build if we fail to build PowerShell.exe before running tests Fail build if we fail to push an artifact because it doesn't exist. --- appveyor.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 1c5185a60..4c211c2b1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -38,9 +38,13 @@ test_script: $ErrorActionPreference = 'Stop' # # CoreCLR - $env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish -Configuration $buildConfiguratio)) + $env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish -Configuration $buildConfiguration)) Write-Host -Foreground Green 'Run CoreCLR tests' $testResultsFile = "$pwd\TestsResults.xml" + if(!(Test-Path "$env:CoreOutput\powershell.exe")) + { + throw "CoreCL PowerShell.exe was not built" + } & ("$env:CoreOutput\powershell.exe") -noprofile -noninteractive -c "Set-ExecutionPolicy -Scope Process Unrestricted; Invoke-Pester test/powershell -Tag 'CI' -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFile" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) @@ -111,10 +115,23 @@ on_finish: $artifacts += (ls .\nuget-artifacts | % {$_.FullName}) + $pushedAllArtifacts = $true $artifacts | % { Write-Host "Pushing $_ as Appveyor artifact" - Push-AppveyorArtifact $_ + if(Test-Path $_) + { + Push-AppveyorArtifact $_ + } + else + { + $pushedAllArtifacts = $false + Write-Warning "Artifact $_ does not exist." + } } + if(!$pushedAllArtifacts) + { + throw "Some artifacts did not exist!" + } } catch { Write-Host -Foreground Red $_ }