Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync eng/common directory with azure-sdk-tools for PR 3124 #1076

Merged
merged 2 commits into from
Apr 12, 2022
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
8 changes: 6 additions & 2 deletions eng/common/TestResources/Remove-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,15 @@ $context = Get-AzContext

if (!$ResourceGroupName) {
if ($CI) {
if (!$ServiceDirectory) {
Write-Warning "ServiceDirectory parameter is empty, nothing to remove"
exit 0
}
$envVarName = (BuildServiceDirectoryPrefix (GetServiceLeafDirectoryName $ServiceDirectory)) + "RESOURCE_GROUP"
$ResourceGroupName = [Environment]::GetEnvironmentVariable($envVarName)
if (!$ResourceGroupName) {
Write-Error "Could not find resource group name environment variable '$envVarName'"
exit 1
Write-Error "Could not find resource group name environment variable '$envVarName'. This is likely due to an earlier failure in the 'Deploy Test Resources' step above."
exit 0
}
} else {
if (!$BaseName) {
Expand Down
2 changes: 1 addition & 1 deletion eng/common/TestResources/SubConfig-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function BuildServiceDirectoryPrefix([string]$serviceName) {
# If the ServiceDirectory has multiple segments use the last directory name
# e.g. D:\foo\bar -> bar or foo/bar -> bar
function GetServiceLeafDirectoryName([string]$serviceDirectory) {
return Split-Path -Leaf $serviceDirectory
return $serviceDirectory ? (Split-Path -Leaf $serviceDirectory) : ""
}

function GetUserName() {
Expand Down