diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index 02e91cc843ac..336854608b2b 100644 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -12,7 +12,10 @@ param( [switch]$Login, [Parameter(ParameterSetName = 'DoLogin')] - [string]$Subscription + [string]$Subscription, + + # Default to true in Azure Pipelines environments + [switch] $CI = ($null -ne $env:SYSTEM_TEAMPROJECTID) ) $ErrorActionPreference = 'Stop' @@ -88,7 +91,7 @@ function DeployStressTests( Run helm repo update if ($LASTEXITCODE) { return $LASTEXITCODE } - $pkgs = FindStressPackages $searchDirectory $filters + $pkgs = FindStressPackages $searchDirectory $filters $CI Write-Host "" "Found $($pkgs.Length) stress test packages:" Write-Host $pkgs.Directory "" foreach ($pkg in $pkgs) { @@ -106,6 +109,8 @@ function DeployStressTests( } exit 1 } + + Write-Host "`nStress test telemetry links (dashboard, fileshare, etc.): https://aka.ms/azsdk/stress/dashboard" } function DeployStressPackage( 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 4d567926f9f8..277f0919988f 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 = @{}) { +function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [boolean]$CI = $false) { # Bare minimum filter for stress tests $filters['stressTest'] = 'true' @@ -18,7 +18,7 @@ function FindStressPackages([string]$directory, [hashtable]$filters = @{}) { foreach ($chartFile in $chartFiles) { $chart = ParseChart $chartFile if (matchesAnnotations $chart $filters) { - $packages += NewStressTestPackageInfo $chart $chartFile + $packages += NewStressTestPackageInfo $chart $chartFile $CI } } @@ -39,9 +39,17 @@ function MatchesAnnotations([hashtable]$chart, [hashtable]$filters) { return $true } -function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile) { +function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile, [boolean]$CI) { + $namespace = if ($CI) { + $chart.annotations.namespace + } else { + $namespace = if ($env:USER) { $env:USER } else { "${env:USERNAME}" } + # Remove spaces, etc. that may be in $namespace + $namespace -replace '\W' + } + return [StressTestPackageInfo]@{ - Namespace = $chart.annotations.namespace + Namespace = $namespace Directory = $chartFile.DirectoryName ReleaseName = $chart.name }