Skip to content

Commit feeb1db

Browse files
authored
enable tests to be skipped during an official build (#6786)
Primarily useful when testing build process changes.
1 parent 858642d commit feeb1db

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.vsts-signed.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ variables:
55
- name: VisualStudioDropName
66
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
77

8+
# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI.
9+
# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
10+
#variables:
11+
#- name: SkipTests
12+
# defaultValue: false
13+
814
jobs:
915
- job: Full_Signed
1016
pool:
@@ -26,6 +32,7 @@ jobs:
2632
- script: eng\CIBuild.cmd
2733
-configuration $(BuildConfiguration)
2834
-testAll
35+
-officialSkipTests $(SkipTests)
2936
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
3037
/p:VisualStudioDropName=$(VisualStudioDropName)
3138
/p:DotNetSignType=$(SignType)
@@ -55,7 +62,7 @@ jobs:
5562
ArtifactName: 'Test Results'
5663
publishLocation: Container
5764
continueOnError: true
58-
condition: succeededOrFailed()
65+
condition: and(succeededOrFailed(), ne(variables['SkipTests'], 'true'))
5966

6067
# Upload VSTS Drop
6168
- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1

azure-pipelines.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variables:
2424
- name: VisualStudioDropName
2525
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
2626

27+
# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI.
28+
# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
29+
#variables:
30+
#- name: SkipTests
31+
# defaultValue: false
32+
2733
jobs:
2834

2935
#---------------------------------------------------------------------------------------------------------------------#
@@ -59,6 +65,7 @@ jobs:
5965
-configuration $(_BuildConfig)
6066
-prepareMachine
6167
-testAll
68+
-officialSkipTests $(SkipTests)
6269
/p:SignType=$(_SignType)
6370
/p:DotNetSignType=$(_SignType)
6471
/p:MicroBuild_SigningEnabled=true

eng/Build.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ param (
5252
[switch]$testFSharpQA,
5353
[switch]$testVs,
5454
[switch]$testAll,
55+
[string]$officialSkipTests = "false",
5556

5657
[parameter(ValueFromRemainingArguments=$true)][string[]]$properties)
5758

@@ -84,6 +85,7 @@ function Print-Usage() {
8485
Write-Host " -testFSharpCore Run FSharpCore unit tests"
8586
Write-Host " -testFSharpQA Run F# Cambridge tests"
8687
Write-Host " -testVs Run F# editor unit tests"
88+
Write-Host " -officialSkipTests <bool> Set to 'true' to skip running tests"
8789
Write-Host ""
8890
Write-Host "Advanced settings:"
8991
Write-Host " -ci Set when running on CI server"
@@ -112,6 +114,17 @@ function Process-Arguments() {
112114
$script:testVs = $True
113115
}
114116

117+
if ([System.Boolean]::Parse($script:officialSkipTests)) {
118+
$script:testAll = $False
119+
$script:testCambridge = $False
120+
$script:testCompiler = $False
121+
$script:testDesktop = $False
122+
$script:testCoreClr = $False
123+
$script:testFSharpCore = $False
124+
$script:testFSharpQA = $False
125+
$script:testVs = $False
126+
}
127+
115128
if ($noRestore) {
116129
$script:restore = $False;
117130
}

0 commit comments

Comments
 (0)