Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions eng/common/scripts/stress-testing/deploy-stress-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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) {
Expand All @@ -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(
Expand Down
16 changes: 12 additions & 4 deletions eng/common/scripts/stress-testing/find-all-stress-packages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
}
}

Expand All @@ -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
}
Expand Down