From 98a94683fd0c2892402be677ddf09451bc65293c Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Thu, 25 Feb 2016 23:48:06 -0800 Subject: [PATCH] Fail appveyor build, if CoreCLR tests failed on windows --- appveyor.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 143f6e2bc..d9e7d643b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,23 +28,29 @@ test_script: - ps: | # fail tests execution, if any PS error detected $ErrorActionPreference = 'Stop' + # # CoreCLR $testResultsFile = ".\TestsResults.xml" .\bin\powershell.exe --noprofile -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) - # For now we don't fail the build if these tests failed # # FullCLR Import-Module .\PowerShellGitHubDev.psm1 $testResultsFile = ".\TestsResults.FullCLR.xml" Start-DevPSGitHub -binDir $pwd\binFull -NoNewWindow -ArgumentList '-command', "Import-Module .\bin\Modules\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFile" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) - # we want to fail the build, if these tests failed + # + # Fail the build, if tests failed $x = [xml](cat -raw .\TestsResults.FullCLR.xml) if ([int]$x.'test-results'.failures -gt 0) { throw "$($x.'test-results'.failures) tests in test/fullCLR failed" } + $x = [xml](cat -raw .\TestsResults.xml) + if ([int]$x.'test-results'.failures -gt 0) + { + throw "$($x.'test-results'.failures) tests in test/powershell failed" + } on_finish: - ps: |