Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed6cc1e

Browse files
azure-sdkbenbp
andauthored
Stress test usability feedback (Azure#18513)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 2274b28 commit ed6cc1e

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

eng/common/scripts/stress-testing/deploy-stress-tests.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ param(
1212
[switch]$Login,
1313

1414
[Parameter(ParameterSetName = 'DoLogin')]
15-
[string]$Subscription
15+
[string]$Subscription,
16+
17+
# Default to true in Azure Pipelines environments
18+
[switch] $CI = ($null -ne $env:SYSTEM_TEAMPROJECTID)
1619
)
1720

1821
$ErrorActionPreference = 'Stop'
@@ -88,7 +91,7 @@ function DeployStressTests(
8891
Run helm repo update
8992
if ($LASTEXITCODE) { return $LASTEXITCODE }
9093

91-
$pkgs = FindStressPackages $searchDirectory $filters
94+
$pkgs = FindStressPackages $searchDirectory $filters $CI
9295
Write-Host "" "Found $($pkgs.Length) stress test packages:"
9396
Write-Host $pkgs.Directory ""
9497
foreach ($pkg in $pkgs) {
@@ -106,6 +109,8 @@ function DeployStressTests(
106109
}
107110
exit 1
108111
}
112+
113+
Write-Host "`nStress test telemetry links (dashboard, fileshare, etc.): https://aka.ms/azsdk/stress/dashboard"
109114
}
110115

111116
function DeployStressPackage(

eng/common/scripts/stress-testing/find-all-stress-packages.ps1

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class StressTestPackageInfo {
99
[string]$ReleaseName
1010
}
1111

12-
function FindStressPackages([string]$directory, [hashtable]$filters = @{}) {
12+
function FindStressPackages([string]$directory, [hashtable]$filters = @{}, [boolean]$CI = $false) {
1313
# Bare minimum filter for stress tests
1414
$filters['stressTest'] = 'true'
1515

@@ -18,7 +18,7 @@ function FindStressPackages([string]$directory, [hashtable]$filters = @{}) {
1818
foreach ($chartFile in $chartFiles) {
1919
$chart = ParseChart $chartFile
2020
if (matchesAnnotations $chart $filters) {
21-
$packages += NewStressTestPackageInfo $chart $chartFile
21+
$packages += NewStressTestPackageInfo $chart $chartFile $CI
2222
}
2323
}
2424

@@ -39,9 +39,17 @@ function MatchesAnnotations([hashtable]$chart, [hashtable]$filters) {
3939
return $true
4040
}
4141

42-
function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile) {
42+
function NewStressTestPackageInfo([hashtable]$chart, [System.IO.FileInfo]$chartFile, [boolean]$CI) {
43+
$namespace = if ($CI) {
44+
$chart.annotations.namespace
45+
} else {
46+
$namespace = if ($env:USER) { $env:USER } else { "${env:USERNAME}" }
47+
# Remove spaces, etc. that may be in $namespace
48+
$namespace -replace '\W'
49+
}
50+
4351
return [StressTestPackageInfo]@{
44-
Namespace = $chart.annotations.namespace
52+
Namespace = $namespace
4553
Directory = $chartFile.DirectoryName
4654
ReleaseName = $chart.name
4755
}

0 commit comments

Comments
 (0)