File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
eng/common/scripts/stress-testing Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,16 @@ function GenerateScenarioMatrix(
3939 $scenariosMatrix += $entry
4040 }
4141
42- $valuesYaml = Get-Content - Raw (Join-Path (Split-Path $matrixFilePath ) ' values.yaml' )
43- $values = $valuesYaml | ConvertFrom-Yaml - Ordered
44- if (! $values ) {$values = @ {}}
42+ $valuesConfig = Join-Path (Split-Path $matrixFilePath ) ' values.yaml'
43+ $values = [ordered ]@ {}
44+ if (Test-Path $valuesConfig ) {
45+ $valuesYaml = Get-Content - Raw $valuesConfig
46+ $values = $valuesYaml | ConvertFrom-Yaml - Ordered
47+ if (! $values ) {$values = @ {}}
4548
46- if ($values.ContainsKey (' Scenarios' )) {
47- throw " Please use matrix generation for stress test scenarios."
49+ if ($values.ContainsKey (' Scenarios' )) {
50+ throw " Please use matrix generation for stress test scenarios."
51+ }
4852 }
4953
5054 $values.scenarios = $scenariosMatrix
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ function DeployStressPackage(
248248 }
249249 }
250250 }
251- $genVal.scenarios = foreach ($scenario in $genVal.scenarios ) {
251+ $genVal.scenarios = @ ( foreach ($scenario in $genVal.scenarios ) {
252252 $dockerPath = Join-Path $pkg.Directory $scenario.image
253253 if (" image" -notin $scenario ) {
254254 $dockerPath = $dockerFilePath
@@ -257,7 +257,7 @@ function DeployStressPackage(
257257 $scenario.imageTag = $imageTag
258258 }
259259 $scenario
260- }
260+ } )
261261
262262 $genVal | ConvertTo-Yaml | Out-File - FilePath $genValFile
263263 }
You can’t perform that action at this time.
0 commit comments