Skip to content

Commit 81bd4e5

Browse files
azure-sdkbenbp
andauthored
Fix unhelpful error when no stress packages are found (#53380)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 3d003fa commit 81bd4e5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

eng/common/scripts/stress-testing/find-all-stress-packages.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ function FindStressPackages(
3131
$filters['stressTest'] = 'true'
3232
$packages = @()
3333
$chartFiles = Get-ChildItem -Recurse -Filter 'Chart.yaml' $directory
34-
Write-Host "Found chart files:"
35-
Write-Host ($chartFiles -join "`n")
34+
if ($chartFiles) {
35+
Write-Host "Found chart files:"
36+
Write-Host ($chartFiles -join "`n")
37+
}
3638

3739
if (!$MatrixFileName) {
3840
$MatrixFileName = 'scenarios-matrix.yaml'

eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ function DeployStressTests(
172172
-MatrixFilters $MatrixFilters `
173173
-MatrixReplace $MatrixReplace `
174174
-MatrixNonSparseParameters $MatrixNonSparseParameters)
175+
if (!$pkgs -or !$pkgs.Length) {
176+
Write-Warning "No stress test packages found in $searchDirectory"
177+
exit 0
178+
}
175179
Write-Host "" "Found $($pkgs.Length) stress test packages:"
176180
Write-Host $pkgs.Directory ""
177181
foreach ($pkg in $pkgs) {

0 commit comments

Comments
 (0)