mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fail appveyor build, if CoreCLR tests failed on windows
This commit is contained in:
1 parent
23a83184ff
commit
98a94683fd
1 file changed
+8
-2
+8
-2
@@ -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: |
|
||||
|
||||
Reference in new issue
Block a user