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 2e71a6bd7396..fd0f7c9184fb 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -321,7 +321,20 @@ function DeployStressPackage( $generatedConfigPath = Join-Path $pkg.Directory generatedValues.yaml $subCommand = $Template ? "template" : "upgrade" $subCommandFlag = $Template ? "--debug" : "--install" - $helmCommandArg = "helm", $subCommand, $releaseName, $pkg.Directory, "-n", $pkg.Namespace, $subCommandFlag, "--values", $generatedConfigPath, "--set", "stress-test-addons.env=$environment" + $helmCommandArg = @( + "helm", $subCommand, $releaseName, $pkg.Directory, + "-n", $pkg.Namespace, + $subCommandFlag, + "--values", $generatedConfigPath, + "--set", "stress-test-addons.env=$environment" + ) + + Push-Location $pkg.Directory + $gitCommit = git rev-parse HEAD 2>&1 + Pop-Location + if (!$LASTEXITCODE) { + $helmCommandArg += "--set", "GitCommit=$gitCommit" + } if ($LockDeletionForDays) { $date = (Get-Date).AddDays($LockDeletionForDays).ToUniversalTime()