From 62ea152e4ac61311b2bdf1ae280a9d973a244f24 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 1 Apr 2022 15:34:21 -0700 Subject: [PATCH] Support nested service directories for local test resources resource group names (#2167) Co-authored-by: Ben Broderick Phillips --- eng/common/TestResources/New-TestResources.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 27885c244f..6abeb291cb 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -377,7 +377,9 @@ try { $BaseName = 't' + (New-Guid).ToString('n').Substring(0, 16) Log "Generated base name '$BaseName' for CI build" } elseif (!$BaseName) { - $BaseName = "$UserName$ServiceDirectory" + # Handle service directories in nested directories, e.g. `data/aztables` + $serviceDirectorySafeName = $ServiceDirectory -replace '[/\\]', '' + $BaseName = "$UserName$serviceDirectorySafeName" Log "BaseName was not set. Using default base name '$BaseName'" }