Skip to content

Commit 02c2421

Browse files
Test return of empty array from Get-PathsToTest
1 parent 8ed9fd9 commit 02c2421

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

eng/pipelines/templates/jobs/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ parameters:
1616
jobs:
1717
- job: Build_${{ parameters.OSName }}
1818
displayName: "Build"
19-
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'), ne(stageDependencies.Initialize.Initialize.outputs['SetPRSkipJobVariables.SkipBuildJob'], 'true'))
19+
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'))
2020
strategy:
2121
maxParallel: ${{ parameters.MaxParallel }}
2222
matrix: $[ ${{ parameters.Matrix }} ]

eng/pipelines/templates/jobs/initialize.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
- checkout: self
1616
fetchDepth: 0
1717

18-
- task: PowerShell@2
19-
displayName: "Set PR skip job variables"
20-
name: SetPRSkipJobVariables
21-
condition: eq(variables['Build.Reason'], 'PullRequest')
22-
inputs:
23-
pwsh: true
24-
filePath: $(Build.SourcesDirectory)/eng/scripts/Set-SkipJobVariables.ps1
18+
#- task: PowerShell@2
19+
# displayName: "Set PR skip job variables"
20+
# name: SetPRSkipJobVariables
21+
# condition: eq(variables['Build.Reason'], 'PullRequest')
22+
# inputs:
23+
# pwsh: true
24+
# filePath: $(Build.SourcesDirectory)/eng/scripts/Set-SkipJobVariables.ps1
2525

2626
- task: UseDotNet@2
2727
displayName: "Use .NET SDK from global.json"

eng/pipelines/templates/jobs/live-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
displayName: "Live tests -"
1212
timeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
1313
# The variable reference in the matrix parameter will resolve to a json map. If there are no live test legs, it will be an empty map.
14-
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'), ne(stageDependencies.Initialize.Initialize.outputs['SetPRSkipJobVariables.SkipLiveTestJob'], 'true'))
14+
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'))
1515
strategy:
1616
maxParallel: ${{ parameters.MaxParallel }}
1717
matrix: $[ ${{ parameters.Matrix }} ]

eng/scripts/New-BuildInfo.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ $linuxVmImage = CheckVariable 'LINUXVMIMAGE'
148148
$macVmImage = CheckVariable 'MACVMIMAGE'
149149

150150
function Get-PathsToTest {
151+
return @()
151152
Write-Host "Getting paths to test"
152153

153154
# When "core" is modified, include storage and keyVault as the canary service tools.
@@ -535,10 +536,13 @@ function Get-BuildMatrices {
535536
Push-Location $RepoRoot
536537
try {
537538
$serverDetails = @(Get-ServerDetails)
538-
$matrices = Get-BuildMatrices $serverDetails
539-
540539
$pathsToTest = @(Get-PathsToTest)
541-
$matrices['liveTestMatrix'] = Get-TestMatrix $pathsToTest -TestType 'Live'
540+
$matrices = [ordered]@{}
541+
542+
if ($pathsToTest.Count -gt 0) {
543+
$matrices = Get-BuildMatrices $serverDetails
544+
$matrices['liveTestMatrix'] = Get-TestMatrix $pathsToTest -TestType 'Live'
545+
}
542546

543547
# spellchecker: ignore SOURCEVERSION
544548
$branch = $isPipelineRun ? (CheckVariable 'BUILD_SOURCEBRANCH') : (git rev-parse --abbrev-ref HEAD)

0 commit comments

Comments
 (0)