Skip to content

Commit

Permalink
JobMatrix write host
Browse files Browse the repository at this point in the history
  • Loading branch information
ckairen committed Oct 20, 2022
1 parent e85b8bc commit efbbaba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions eng/common/scripts/Helpers/PSModule-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function Update-PSModulePathForCI()
$modulePaths = $modulePaths.Where({ !$_.StartsWith($hostedAgentModulePath) })

# Add any "az_" paths from the agent which is the lastest set of azure modules
$AzModuleCachPath = (Get-ChildItem "$hostedAgentModulePath/az_*" -Attributes Directory) -join $moduleSeperator
if ($AzModuleCachPath -and $env.PSModulePath -notcontains $AzModuleCachPath) {
$modulePaths += $AzModuleCachPath
$AzModuleCachePath = (Get-ChildItem "$hostedAgentModulePath/az_*" -Attributes Directory) -join $moduleSeperator
if ($AzModuleCachePath -and $env:PSModulePath -notcontains $AzModuleCachePath) {
$modulePaths += $AzModuleCachePath
}

$env:PSModulePath = $modulePaths -join $moduleSeperator
Expand Down
2 changes: 1 addition & 1 deletion eng/common/scripts/job-matrix/Create-JobMatrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Write-Output $serialized.pretty

if ($null -ne $env:SYSTEM_TEAMPROJECTID) {
Write-Output "##vso[task.setVariable variable=matrix;isOutput=true]$($serialized.compressed)"
}
}
4 changes: 2 additions & 2 deletions eng/common/scripts/job-matrix/job-matrix-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function ProcessNonSparseParameters(

function FilterMatrixDisplayName([array]$matrix, [string]$filter) {
return $matrix | Where-Object { $_ } | ForEach-Object {
if ($_.Name -match $filter) {
if ($_.ContainsKey("Name") -and $_.Name -match $filter) {
return $_
}
}
Expand All @@ -169,7 +169,7 @@ function MatchesFilters([hashtable]$entry, [array]$filters) {
# Default all regex checks to go against empty string when keys are missing.
# This simplifies the filter syntax/interface to be regex only.
$value = ""
if ($null -ne $entry -and $entry.parameters.Contains($key)) {
if ($null -ne $entry -and $entry.ContainsKey("parameters") -and $entry.parameters.Contains($key)) {
$value = $entry.parameters[$key]
}
if ($value -notmatch $regex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function GenerateScenarioMatrix(
-Filters $Filters `
-Replace $Replace `
-NonSparseParameters $NonSparseParameters
Write-Host $prettyMatrix
$prettyMatrix = $prettyMatrix | ConvertFrom-Json

$scenariosMatrix = @()
Expand Down

0 comments on commit efbbaba

Please sign in to comment.