Skip to content

Commit d165f80

Browse files
azure-sdkbenbp
andauthored
Add env var skip for matrix debug. Add acceptance test tag (Azure#24392)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 0b83b64 commit d165f80

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

eng/common/scripts/job-matrix/Create-JobMatrix.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ param (
1515
[Parameter(Mandatory=$False)][array] $Filters,
1616
[Parameter(Mandatory=$False)][array] $Replace,
1717
[Parameter(Mandatory=$False)][array] $NonSparseParameters,
18+
# Use for local generation/debugging when env: values are set in a matrix
19+
[Parameter(Mandatory=$False)][switch] $SkipEnvironmentVariables,
1820
[Parameter()][switch] $CI = ($null -ne $env:SYSTEM_TEAMPROJECTID)
1921
)
2022

@@ -34,7 +36,8 @@ $Filters = $Filters | Where-Object { $_ }
3436
-displayNameFilter $DisplayNameFilter `
3537
-filters $Filters `
3638
-replace $Replace `
37-
-nonSparseParameters $NonSparseParameters
39+
-nonSparseParameters $NonSparseParameters `
40+
-skipEnvironmentVariables:$SkipEnvironmentVariables
3841

3942
$serialized = SerializePipelineMatrix $matrix
4043

eng/common/scripts/job-matrix/job-matrix-functions.ps1

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ function GenerateMatrix(
101101
) {
102102
$result = ProcessImport $config.matrixParameters $selectFromMatrixType $nonSparseParameters $config.displayNamesLookup
103103

104-
$matrixParameters = $result.Matrix
105-
$importedMatrix = $result.ImportedMatrix
104+
$matrixParameters = $result.Matrix
105+
$importedMatrix = $result.ImportedMatrix
106106
$combinedDisplayNameLookup = $result.DisplayNamesLookup
107107

108108
if ($selectFromMatrixType -eq "sparse") {
@@ -148,7 +148,7 @@ function ProcessNonSparseParameters(
148148
$nonSparse = [MatrixParameter[]]@()
149149

150150
foreach ($param in $parameters) {
151-
if ($null -eq $param){
151+
if ($null -eq $param) {
152152
continue
153153
}
154154
if ($param.Name -in $nonSparseParameters) {
@@ -430,9 +430,9 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
430430
}
431431
if ((!$matrix -and !$importPath) -or !$importPath) {
432432
return [PSCustomObject]@{
433-
Matrix = $matrix
434-
ImportedMatrix = @()
435-
DisplayNamesLookup = $displayNamesLookup
433+
Matrix = $matrix
434+
ImportedMatrix = @()
435+
DisplayNamesLookup = $displayNamesLookup
436436
}
437437
}
438438

@@ -456,9 +456,9 @@ function ProcessImport([MatrixParameter[]]$matrix, [String]$selection, [Array]$n
456456
}
457457

458458
return [PSCustomObject]@{
459-
Matrix = $matrix ?? @()
460-
ImportedMatrix = $importedMatrix
461-
DisplayNamesLookup = $combinedDisplayNameLookup
459+
Matrix = $matrix ?? @()
460+
ImportedMatrix = $importedMatrix
461+
DisplayNamesLookup = $combinedDisplayNameLookup
462462
}
463463
}
464464

@@ -643,7 +643,7 @@ function InitializeMatrix {
643643
function GetMatrixDimensions([MatrixParameter[]]$parameters) {
644644
$dimensions = @()
645645
foreach ($param in $parameters) {
646-
if ($null -eq $param){
646+
if ($null -eq $param) {
647647
continue
648648
}
649649
$dimensions += $param.Length()
@@ -760,12 +760,12 @@ function Get4dMatrixIndex([int]$index, [Array]$dimensions) {
760760

761761
function GenerateMatrixForConfig {
762762
param (
763-
[Parameter(Mandatory = $true)][string] $ConfigPath,
764-
[Parameter(Mandatory = $true)][string] $Selection,
765-
[Parameter(Mandatory = $false)][string] $DisplayNameFilter,
766-
[Parameter(Mandatory = $false)][array] $Filters,
767-
[Parameter(Mandatory = $false)][array] $Replace,
768-
[Parameter(Mandatory = $false)][Array] $NonSparseParameters = @()
763+
[Parameter(Mandatory = $true)][string] $ConfigPath,
764+
[Parameter(Mandatory = $true)][string] $Selection,
765+
[Parameter(Mandatory = $false)][string] $DisplayNameFilter,
766+
[Parameter(Mandatory = $false)][array] $Filters,
767+
[Parameter(Mandatory = $false)][array] $Replace,
768+
[Parameter(Mandatory = $false)][Array] $NonSparseParameters = @()
769769
)
770770
$matrixFile = Join-Path $PSScriptRoot ".." ".." ".." ".." $ConfigPath
771771

@@ -776,12 +776,12 @@ function GenerateMatrixForConfig {
776776
$Filters = $Filters | Where-Object { $_ }
777777

778778
[array]$matrix = GenerateMatrix `
779-
-config $config `
780-
-selectFromMatrixType $Selection `
781-
-displayNameFilter $DisplayNameFilter `
782-
-filters $Filters `
783-
-replace $Replace `
784-
-nonSparseParameters $NonSparseParameters
779+
-config $config `
780+
-selectFromMatrixType $Selection `
781+
-displayNameFilter $DisplayNameFilter `
782+
-filters $Filters `
783+
-replace $Replace `
784+
-nonSparseParameters $NonSparseParameters
785785

786786
return , $matrix
787787
}

0 commit comments

Comments
 (0)