Fix unhelpful error when no stress packages are found (#6798)

Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
This commit is contained in:
Azure SDK Bot 2025-12-04 12:10:03 -08:00 committed by GitHub
parent d857c1c7d1
commit 8d08a098ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -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'

View File

@ -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) {