From 6504849071454f0569e2107f05844aa0476d214e Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Thu, 16 Oct 2025 15:39:54 -0400 Subject: [PATCH] Fix unhelpful error when no stress packages are found --- .../scripts/stress-testing/find-all-stress-packages.ps1 | 6 ++++-- .../scripts/stress-testing/stress-test-deployment-lib.ps1 | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 index 64df21a3a8..f595f8e7fd 100644 --- a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 +++ b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 @@ -31,8 +31,10 @@ function FindStressPackages( $filters['stressTest'] = 'true' $packages = @() $chartFiles = Get-ChildItem -Recurse -Filter 'Chart.yaml' $directory - Write-Host "Found chart files:" - Write-Host ($chartFiles -join "`n") + if ($chartFiles) { + Write-Host "Found chart files:" + Write-Host ($chartFiles -join "`n") + } if (!$MatrixFileName) { $MatrixFileName = 'scenarios-matrix.yaml' diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index a2ec15999a..a9f45a0a9a 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -172,6 +172,10 @@ function DeployStressTests( -MatrixFilters $MatrixFilters ` -MatrixReplace $MatrixReplace ` -MatrixNonSparseParameters $MatrixNonSparseParameters) + if (!$pkgs -or !$pkgs.Length) { + Write-Warning "No stress test packages found in $searchDirectory" + exit 0 + } Write-Host "" "Found $($pkgs.Length) stress test packages:" Write-Host $pkgs.Directory "" foreach ($pkg in $pkgs) {