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(
39
39
$scenariosMatrix += $entry
40
40
}
41
41
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 = @ {}}
45
48
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
+ }
48
52
}
49
53
50
54
$values.scenarios = $scenariosMatrix
Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ function DeployStressPackage(
248
248
}
249
249
}
250
250
}
251
- $genVal.scenarios = foreach ($scenario in $genVal.scenarios ) {
251
+ $genVal.scenarios = @ ( foreach ($scenario in $genVal.scenarios ) {
252
252
$dockerPath = Join-Path $pkg.Directory $scenario.image
253
253
if (" image" -notin $scenario ) {
254
254
$dockerPath = $dockerFilePath
@@ -257,7 +257,7 @@ function DeployStressPackage(
257
257
$scenario.imageTag = $imageTag
258
258
}
259
259
$scenario
260
- }
260
+ } )
261
261
262
262
$genVal | ConvertTo-Yaml | Out-File - FilePath $genValFile
263
263
}
You can’t perform that action at this time.
0 commit comments