From 3be547c78e9878865445ca8e9108e914f029b80d Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 4 Apr 2017 09:23:51 -0700 Subject: [PATCH] Skip the parser tests that are run by 'ShouldBeParseError' in Travis Full Build (#3479) --- .../Scripting.Classes.BasicParsing.Tests.ps1 | 8 ++++++-- .../Language/LanguageTestSupport.psm1 | 20 ++++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index 076cb0650..dd9ead0dd 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -11,11 +11,15 @@ try { # 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. +# 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 # $isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' $defaultParamValues = $PSdefaultParameterValues.Clone() -$PSDefaultParameterValues["it:skip"] = (!$IsWindows -and $isFullBuild) +$IsSkipped = (!$IsWindows -and $isFullBuild) +$PSDefaultParameterValues["it:skip"] = $IsSkipped +$PSDefaultParameterValues["ShouldBeParseError:SkipInTravisFullBuild"] = $IsSkipped + Describe 'Positive Parse Properties Tests' -Tags "CI" { It 'PositiveParsePropertiesTest' { diff --git a/test/powershell/Language/LanguageTestSupport.psm1 b/test/powershell/Language/LanguageTestSupport.psm1 index 75efbd79e..742b521c4 100644 --- a/test/powershell/Language/LanguageTestSupport.psm1 +++ b/test/powershell/Language/LanguageTestSupport.psm1 @@ -65,9 +65,27 @@ 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 + [switch]$CheckColumnNumber, + # Skip this test in Travis CI nightly build + [switch]$SkipInTravisFullBuild ) + # + # CrossGen'ed assemblies cause a hang to happen when running tests with this helper function in Linux and OSX. + # 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 test and return + It "Parse error expected: <<$src>>" -Skip {} + return + } + Context "Parse error expected: <<$src>>" { # Test case error if this fails $expectedErrors.Count | Should Be $expectedOffsets.Count