Skip to content

Commit

Permalink
JobMatrix write host
Browse files Browse the repository at this point in the history
  • Loading branch information
ckairen authored and azure-sdk committed Oct 20, 2022
1 parent 48a4064 commit ceed15f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 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
6 changes: 3 additions & 3 deletions eng/common/scripts/job-matrix/Create-JobMatrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ param (
[Parameter(Mandatory=$False)][array] $NonSparseParameters
)

Set-PSDebug -Trace 1

. $PSScriptRoot/job-matrix-functions.ps1

if (!(Test-Path $ConfigPath)) {
Expand All @@ -39,6 +41,4 @@ $serialized = SerializePipelineMatrix $matrix

Write-Output $serialized.pretty

if ($null -ne $env:SYSTEM_TEAMPROJECTID) {
Write-Output "##vso[task.setVariable variable=matrix;isOutput=true]$($serialized.compressed)"
}
Write-Host "##vso[task.setVariable variable=matrix;isOutput=true]$($serialized.compressed)"
2 changes: 1 addition & 1 deletion eng/common/scripts/job-matrix/job-matrix-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.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 ceed15f

Please sign in to comment.