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 883fda959..7a68de0fe 100644 --- a/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 +++ b/eng/common/scripts/stress-testing/find-all-stress-packages.ps1 @@ -9,7 +9,7 @@ class StressTestPackageInfo { [string]$ReleaseName } -function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [boolean]$CI = $false) { +function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [switch]$CI) { # Bare minimum filter for stress tests $filters['stressTest'] = 'true' @@ -18,7 +18,7 @@ function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [bool foreach ($chartFile in $chartFiles) { $chart = ParseChart $chartFile if (matchesAnnotations $chart $filters) { - $packages += NewStressTestPackageInfo $chart $chartFile $CI + $packages += NewStressTestPackageInfo -chart $chart -chartFile $chartFile -CI:$CI } } @@ -39,7 +39,7 @@ function MatchesAnnotations([hashtable]$chart, [hashtable]$filters) { return $true } -function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile, [boolean]$CI) { +function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile, [switch]$CI) { $namespace = if ($CI) { $chart.annotations.namespace } else { 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 ca0f59ed6..eb6254662 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -63,7 +63,7 @@ function DeployStressTests( [string]$deployId = 'local', [switch]$login, [string]$subscription = '', - [switch]$ci + [switch]$CI ) { if ($environment -eq 'test') { if ($clusterGroup -or $subscription) { @@ -89,19 +89,25 @@ function DeployStressTests( if (!$clusterGroup -or !$subscription) { throw "clusterGroup and subscription parameters must be specified when logging into an environment that is not test or prod." } - Login $subscription $clusterGroup $pushImages + Login -subscription $subscription -clusterGroup $clusterGroup -pushImages:$pushImages } RunOrExitOnFailure helm repo add stress-test-charts https://stresstestcharts.blob.core.windows.net/helm/ Run helm repo update if ($LASTEXITCODE) { return $LASTEXITCODE } - $pkgs = FindStressPackages $searchDirectory $filters $CI + $pkgs = FindStressPackages -directory $searchDirectory -filters $filters -CI:$CI Write-Host "" "Found $($pkgs.Length) stress test packages:" Write-Host $pkgs.Directory "" foreach ($pkg in $pkgs) { Write-Host "Deploying stress test at '$($pkg.Directory)'" - DeployStressPackage $pkg $deployId $environment $repository $pushImages $login + DeployStressPackage ` + -pkg $pkg ` + -deployId $deployId ` + -environment $environment ` + -repositoryBase $repository ` + -pushImages:$pushImages ` + -login:$login } Write-Host "Releases deployed by $deployId"