From fcd5257bbba5d73d6ab1c35dc1997612a3f13a88 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 9 Aug 2017 10:56:44 -0700 Subject: [PATCH 1/3] Fix the hang issue in Travis CI build triggered by the [Feature] tag --- .../scripting.Classes.inheritance.tests.ps1 | 22 +++++++++++++++++++ tools/travis.ps1 | 9 +++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 index b505849c21d..eea7f136994 100644 --- a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 @@ -2,6 +2,24 @@ # Copyright (c) Microsoft Corporation, 2015 # +try { +# +# CrossGen'ed assemblies cause a hang to happen intermittently when running this test suite 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 +# +$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' +$defaultParamValues = $PSdefaultParameterValues.Clone() +$IsSkipped = (!$IsWindows -and $isFullBuild) +$PSDefaultParameterValues["it:skip"] = $IsSkipped +$PSDefaultParameterValues["ShouldBeParseError:SkipInTravisFullBuild"] = $IsSkipped + + Describe 'Classes inheritance syntax' -Tags "CI" { It 'Base types' { @@ -521,3 +539,7 @@ class Derived : Base $sb.Invoke() | Should Be 200 } } + +} finally { + $global:PSdefaultParameterValues = $defaultParamValues +} diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 58e425781d5..6784b625a71 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -110,7 +110,9 @@ else # Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]` -$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' -or $commitMessage -match '\[feature\]' +$hasFeatureTag = $commitMessage -match '\[feature\]' +$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' +$isFullBuild = $isDailyBuild -or $hasFeatureTag if($Bootstrap.IsPresent) { @@ -140,7 +142,8 @@ else $originalProgressPreference = $ProgressPreference $ProgressPreference = 'SilentlyContinue' try { - Start-PSBuild -CrossGen:$isFullBuild -PSModuleRestore + ## We use CrossGen build to run tests only if it's the daily build. + Start-PSBuild -CrossGen:$isDailyBuild -PSModuleRestore } finally{ $ProgressPreference = $originalProgressPreference @@ -167,7 +170,7 @@ else 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 $isFullBuild) { Start-PSBuild -CrossGen } + if (-not $isDailyBuild) { Start-PSBuild -CrossGen } $packageParams = @{} if($env:TRAVIS_BUILD_NUMBER) From f0edf99e72292801d86b2418cf977934bdf96f2a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 9 Aug 2017 11:26:23 -0700 Subject: [PATCH 2/3] [Feature] Update badge only in daily build --- tools/travis.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 6784b625a71..b60733610f2 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -199,7 +199,7 @@ else $resultError = $_ $result = "FAIL" } - if ( $isFullBuild ) { + if ( $isDailyBuild ) { # now update the badge if you've done a full build, these are not fatal issues try { $svgData = Get-DailyBadge -result $result From d5176c644b6c2c0a752ac48db44f9a50991f3475 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 9 Aug 2017 11:54:12 -0700 Subject: [PATCH 3/3] [Feature] Use the term 'daily build' --- .../Classes/Scripting.Classes.BasicParsing.Tests.ps1 | 8 ++++---- .../Classes/scripting.Classes.inheritance.tests.ps1 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index 352fc196012..9d461e0b27b 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -7,15 +7,15 @@ try { # CrossGen'ed assemblies cause a hang to happen intermittently when running this test suite 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 +# 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 # -$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' +$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' $defaultParamValues = $PSdefaultParameterValues.Clone() -$IsSkipped = (!$IsWindows -and $isFullBuild) +$IsSkipped = (!$IsWindows -and $isDailyBuild) $PSDefaultParameterValues["it:skip"] = $IsSkipped $PSDefaultParameterValues["ShouldBeParseError:SkipInTravisFullBuild"] = $IsSkipped diff --git a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 index eea7f136994..2c951cb3ba3 100644 --- a/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 +++ b/test/powershell/Language/Classes/scripting.Classes.inheritance.tests.ps1 @@ -7,15 +7,15 @@ try { # CrossGen'ed assemblies cause a hang to happen intermittently when running this test suite 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 +# 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 # -$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' +$isDailyBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' $defaultParamValues = $PSdefaultParameterValues.Clone() -$IsSkipped = (!$IsWindows -and $isFullBuild) +$IsSkipped = (!$IsWindows -and $isDailyBuild) $PSDefaultParameterValues["it:skip"] = $IsSkipped $PSDefaultParameterValues["ShouldBeParseError:SkipInTravisFullBuild"] = $IsSkipped