mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Address comments
Made AppVeyor and TravisCI use similar code
This commit is contained in:
1 parent
414cbe77a1
commit
6f1d1877de
3 files changed
+68
-39
No files matched your search
+10
-16
@@ -9,7 +9,7 @@ function Invoke-AppVeyorFull
|
||||
{
|
||||
Invoke-AppVeyorInstall
|
||||
Invoke-AppVeyorBuild
|
||||
Invoke-AppVeyorTest
|
||||
Invoke-AppVeyorTest -ErrorAction Continue
|
||||
Invoke-AppveyorFinish
|
||||
}
|
||||
|
||||
@@ -86,6 +86,8 @@ function Update-AppVeyorTestResults
|
||||
# Implement AppVeyor 'Test_script'
|
||||
function Invoke-AppVeyorTest
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
#
|
||||
# CoreCLR
|
||||
$env:CoreOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -Publish -Configuration $buildConfiguration))
|
||||
@@ -96,7 +98,8 @@ function Invoke-AppVeyorTest
|
||||
throw "CoreCLR 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"
|
||||
Start-PSPester -bindir $env:CoreOutput -outputFile $testResultsFile
|
||||
Write-Host -Foreground Green 'Upload CoreCLR test results'
|
||||
Update-AppVeyorTestResults -resultsFile $testResultsFile
|
||||
|
||||
#
|
||||
@@ -104,26 +107,17 @@ function Invoke-AppVeyorTest
|
||||
$env:FullOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -FullCLR))
|
||||
Write-Host -Foreground Green 'Run FullCLR tests'
|
||||
$testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml"
|
||||
Start-DevPowerShell -FullCLR -NoNewWindow -ArgumentList '-noprofile', '-noninteractive' -Command "Set-ExecutionPolicy -Scope Process Unrestricted; Invoke-Pester test/fullCLR -ExcludeTag 'Slow' -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR"
|
||||
Start-PSPester -FullCLR -bindir $env:FullOutput -outputFile $testResultsFileFullCLR -Tag $null -path 'test/fullCLR'
|
||||
|
||||
Write-Host -Foreground Green 'Upload FullCLR test results'
|
||||
Update-AppVeyorTestResults -resultsFile $testResultsFileFullCLR
|
||||
|
||||
|
||||
#
|
||||
# Fail the build, if tests failed
|
||||
Write-Host -Foreground Green 'Upload CoreCLR test results'
|
||||
$x = [xml](cat -raw $testResultsFile)
|
||||
if ([int]$x.'test-results'.failures -gt 0)
|
||||
{
|
||||
throw "$($x.'test-results'.failures) tests in test/powershell failed"
|
||||
}
|
||||
Test-PSPesterResults -TestResultsFile $testResultsFile
|
||||
|
||||
Write-Host -Foreground Green 'Upload FullCLR test results'
|
||||
$x = [xml](cat -raw $testResultsFileFullCLR)
|
||||
|
||||
if ([int]$x.'test-results'.failures -gt 0)
|
||||
{
|
||||
throw "$($x.'test-results'.failures) tests in test/fullCLR failed"
|
||||
}
|
||||
Test-PSPesterResults -TestResultsFile $testResultsFileFullCLR
|
||||
}
|
||||
|
||||
# Implements AppVeyor 'on_finish' step
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ set -x
|
||||
ulimit -n 4096
|
||||
# Only build packages for branches, not pull requests
|
||||
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
|
||||
powershell -c "Import-Module ./build.psm1; Start-PSBootstrap -Package; Start-PSBuild -CrossGen; Start-PSPackage; Start-PSPester; Start-PSxUnit"
|
||||
powershell -c "Import-Module ./build.psm1; Start-PSBootstrap -Package; Start-PSBuild -CrossGen; Start-PSPackage; Start-PSPester -ThrowOnFailure; Test-PSPesterResults; Start-PSxUnit"
|
||||
else
|
||||
powershell -c "Import-Module ./build.psm1; Start-PSBootstrap; Start-PSBuild -CrossGen; Start-PSPester; Start-PSxUnit"
|
||||
powershell -c "Import-Module ./build.psm1; Start-PSBootstrap; Start-PSBuild -CrossGen; Start-PSPester -ThrowOnFailure; Start-PSxUnit"
|
||||
fi
|
||||
Reference in new issue
Block a user