From bcaaa3bfdb04bb9c4cc964a5946d97db2b1f48bd Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 24 Oct 2024 16:05:06 -0700 Subject: [PATCH] Allow default matrix selection override (#6128) Co-authored-by: Ben Broderick Phillips --- .../stress-testing/find-all-stress-packages.ps1 | 12 +++++++++++- .../stress-testing/stress-test-deployment-lib.ps1 | 2 +- 2 files changed, 12 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 1668407cb7..64df21a3a8 100644 --- a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 +++ b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 @@ -48,11 +48,21 @@ function FindStressPackages( VerifyAddonsVersion $chart $chartFile + # Default to "sparse" matrix selection type, unless a default is specified + # in Chart.yaml annotations, or an override is passed in from the command line + $selection = if ($MatrixSelection) { + $MatrixSelection + } elseif ($chart['annotations'] -and $chart['annotations']['matrixSelection']) { + $chart['annotations']['matrixSelection'] + } else { + "sparse" + } + $matrixFilePath = (Join-Path $chartFile.Directory.FullName $MatrixFileName) if (Test-Path $matrixFilePath) { GenerateScenarioMatrix ` -matrixFilePath $matrixFilePath ` - -Selection $MatrixSelection ` + -Selection $selection ` -DisplayNameFilter $MatrixDisplayNameFilter ` -Filters $MatrixFilters ` -Replace $MatrixReplace ` 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 c67540f3b3..da8c12318a 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -103,7 +103,7 @@ function DeployStressTests( [Parameter(Mandatory=$False)][switch]$Template, [Parameter(Mandatory=$False)][switch]$RetryFailedTests, [Parameter(Mandatory=$False)][string]$MatrixFileName, - [Parameter(Mandatory=$False)][string]$MatrixSelection = "sparse", + [Parameter(Mandatory=$False)][string]$MatrixSelection, [Parameter(Mandatory=$False)][string]$MatrixDisplayNameFilter, [Parameter(Mandatory=$False)][array]$MatrixFilters, [Parameter(Mandatory=$False)][array]$MatrixReplace,