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 2e71a6bd7396a..f05f7388f7881 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,18 @@ 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" + ) + + $gitCommit = git -C $pkg.Directory rev-parse HEAD 2>&1 + if (!$LASTEXITCODE) { + $helmCommandArg += "--set", "GitCommit=$gitCommit" + } if ($LockDeletionForDays) { $date = (Get-Date).AddDays($LockDeletionForDays).ToUniversalTime()