mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Always run test with crossgen'ed assemblies in CI (#5315)
This commit is contained in:
@@ -2,24 +2,6 @@
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
#
|
||||
|
||||
try {
|
||||
#
|
||||
# CrossGen'ed assemblies cause a hang to happen intermittently when running this test suite in Linux and macOS.
|
||||
# The issue has been reported to CoreCLR team. We need to work around it for now with the following approach:
|
||||
# 1. For pull request and push commit, build without '-CrossGen' and run the parsing tests
|
||||
# 2. For daily build, build with '-CrossGen' but don't run the parsing tests
|
||||
# In this way, we will continue to exercise these parsing tests for each CI build, and skip them for daily
|
||||
# build to avoid a hang.
|
||||
# Note: this change should be reverted once the 'CrossGen' issue is fixed by CoreCLR. The issue is tracked by
|
||||
# https://github.com/dotnet/coreclr/issues/9745
|
||||
#
|
||||
$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api'
|
||||
$defaultParamValues = $PSdefaultParameterValues.Clone()
|
||||
$IsSkipped = (!$IsWindows -and $isDailyBuild)
|
||||
$PSDefaultParameterValues["it:skip"] = $IsSkipped
|
||||
$PSDefaultParameterValues["ShouldBeParseError:SkipInTravisFullBuild"] = $IsSkipped
|
||||
|
||||
|
||||
Describe 'Positive Parse Properties Tests' -Tags "CI" {
|
||||
It 'PositiveParsePropertiesTest' {
|
||||
# Just a bunch of random basic things here
|
||||
@@ -859,7 +841,3 @@ Describe 'variable analysis' -Tags "CI" {
|
||||
[B]::getA().getFoo() | Should Be 'foo'
|
||||
}
|
||||
}
|
||||
|
||||
} finally {
|
||||
$global:PSdefaultParameterValues = $defaultParamValues
|
||||
}
|
||||
|
||||
@@ -2,24 +2,6 @@
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
#
|
||||
|
||||
try {
|
||||
#
|
||||
# CrossGen'ed assemblies cause a hang to happen intermittently when running this test suite in Linux and macOS.
|
||||
# The issue has been reported to CoreCLR team. We need to work around it for now with the following approach:
|
||||
# 1. For pull request and push commit, build without '-CrossGen' and run the parsing tests
|
||||
# 2. For daily build, build with '-CrossGen' but don't run the parsing tests
|
||||
# In this way, we will continue to exercise these parsing tests for each CI build, and skip them for daily
|
||||
# build to avoid a hang.
|
||||
# Note: this change should be reverted once the 'CrossGen' issue is fixed by CoreCLR. The issue is tracked by
|
||||
# https://github.com/dotnet/coreclr/issues/9745
|
||||
#
|
||||
$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api'
|
||||
$defaultParamValues = $PSdefaultParameterValues.Clone()
|
||||
$IsSkipped = (!$IsWindows -and $isDailyBuild)
|
||||
$PSDefaultParameterValues["it:skip"] = $IsSkipped
|
||||
$PSDefaultParameterValues["ShouldBeParseError:SkipInTravisFullBuild"] = $IsSkipped
|
||||
|
||||
|
||||
Describe 'Classes inheritance syntax' -Tags "CI" {
|
||||
|
||||
It 'Base types' {
|
||||
@@ -539,7 +521,3 @@ class Derived : Base
|
||||
$sb.Invoke() | Should Be 200
|
||||
}
|
||||
}
|
||||
|
||||
} finally {
|
||||
$global:PSdefaultParameterValues = $defaultParamValues
|
||||
}
|
||||
|
||||
@@ -65,40 +65,9 @@ function ShouldBeParseError
|
||||
# This is a temporary solution after moving type creation from parse time to runtime
|
||||
[switch]$SkipAndCheckRuntimeError,
|
||||
# for test coverarage purpose, tests validate columnNumber or offset
|
||||
[switch]$CheckColumnNumber,
|
||||
# Skip this test in Travis CI nightly build
|
||||
[switch]$SkipInTravisFullBuild
|
||||
[switch]$CheckColumnNumber
|
||||
)
|
||||
|
||||
#
|
||||
# CrossGen'ed assemblies cause a hang to happen when running tests with this helper function in Linux and macOS.
|
||||
# The issue has been reported to CoreCLR team. We need to work around it for now with the following approach:
|
||||
# 1. For pull request and push commit, build without '-CrossGen' and run the parsing tests
|
||||
# 2. For nightly build, build with '-CrossGen' but don't run the parsing tests
|
||||
# In this way, we will continue to exercise these parsing tests for each CI build, and skip them for nightly
|
||||
# build to avoid a hang.
|
||||
# Note: this change should be reverted once the 'CrossGen' issue is fixed by CoreCLR. The issue is tracked by
|
||||
# https://github.com/dotnet/coreclr/issues/9745
|
||||
#
|
||||
if ($SkipInTravisFullBuild) {
|
||||
## Report that we skipped the tests and return
|
||||
## be sure to report the same number of tests
|
||||
## it should have the same appearance as if the tests were run
|
||||
Context "Parse error expected: <<$src>>" {
|
||||
if ($SkipAndCheckRuntimeError)
|
||||
{
|
||||
It "error should happen at parse time, not at runtime" -Skip {}
|
||||
}
|
||||
It "Error count" -Skip { }
|
||||
foreach($expectedError in $expectedErrors)
|
||||
{
|
||||
It "Error Id" -Skip { }
|
||||
It "Error position" -Skip { }
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Context "Parse error expected: <<$src>>" {
|
||||
# Test case error if this fails
|
||||
$expectedErrors.Count | Should Be $expectedOffsets.Count
|
||||
|
||||
+1
-17
@@ -173,23 +173,11 @@ elseif($Stage -eq 'Build')
|
||||
Write-Host -Foreground Green "Executing travis.ps1 `$isPR='$isPr' `$isFullBuild='$isFullBuild' - $commitMessage"
|
||||
$output = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions))
|
||||
|
||||
# CrossGen'ed assemblies cause a hang to happen intermittently when running powershell class
|
||||
# basic parsing tests in Linux/macOS. The hang seems to happen when generating dynamic assemblies.
|
||||
# This issue has been reported to CoreCLR team. We need to work around it for now because
|
||||
# the Travis CI build failures caused by this is draining our builder resource and severely
|
||||
# affect our daily work. The workaround is:
|
||||
# 1. For pull request and push commit, build without '-CrossGen' and run the parsing tests
|
||||
# 2. For nightly build, build with '-CrossGen' but don't run the parsing tests
|
||||
# With this workaround, CI builds triggered by pull request and push commit will exercise
|
||||
# the parsing tests with IL assemblies, while nightly builds will exercise CrossGen'ed assemblies
|
||||
# without running those class parsing tests so as to avoid the hang.
|
||||
# NOTE: this change should be reverted once the 'CrossGen' issue is fixed by CoreCLR. The issue
|
||||
# is tracked by https://github.com/dotnet/coreclr/issues/9745
|
||||
$originalProgressPreference = $ProgressPreference
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
try {
|
||||
## We use CrossGen build to run tests only if it's the daily build.
|
||||
Start-PSBuild -CrossGen:$isDailyBuild -PSModuleRestore
|
||||
Start-PSBuild -CrossGen -PSModuleRestore
|
||||
}
|
||||
finally{
|
||||
$ProgressPreference = $originalProgressPreference
|
||||
@@ -245,10 +233,6 @@ elseif($Stage -eq 'Build')
|
||||
}
|
||||
|
||||
if (-not $isPr) {
|
||||
# Run 'CrossGen' for push commit, so that we can generate package.
|
||||
# It won't rebuild powershell, but only CrossGen the already built assemblies.
|
||||
if (-not $isDailyBuild) { Start-PSBuild -CrossGen }
|
||||
|
||||
$packageParams = @{}
|
||||
if($env:TRAVIS_BUILD_NUMBER)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user