Skip to content

Commit 15aa35d

Browse files
azure-sdkscbedd
andauthored
Sync eng/common directory with azure-sdk-tools for PR 5568 (Azure#20290)
* we encourage folks to place their assets.jsons at the package level * update generate-assets-json.ps1 to only include src/**/session-records so as to avoid picking up the duplicated 'target' sessionrecords --------- Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
1 parent 09b540e commit 15aa35d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

eng/common/testproxy/transition-scripts/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ You will not be able to clean them up however. There exists [planned work](https
6060
- `language` repo - An individual language repository eg. azure-sdk-for-python or azure-sdk-for-net etc.
6161
- `assets` repo - The repository where assets are being moved to. <https://github.com/Azure/azure-sdk-assets>
6262

63-
The `test-proxy` tool is integrated with the ability to automatically restore these assets. This process is kick-started by the presence of an `assets.json` alongside a dev's actual code. This means that while assets will be cloned down externally, the _map_ to those assets will be stored alongside the tests. Normally, it is recommended to create an `assets.json` under the path `sdk/<ServiceDirectory>`. However, more granular storage is also possible.
63+
The `test-proxy` tool is integrated with the ability to automatically restore these assets. This process is kick-started by the presence of an `assets.json` alongside a dev's actual code. This means that while assets will be cloned down externally, the _map_ to those assets will be stored alongside the tests. Normally, it is recommended to create an `assets.json` under the path `sdk/<ServiceDirectory>/<package>`. More granular storage than on an individual package level is possible, but each language's test framework would need to support that on a case-by-case basis.
6464

65-
Service/Package-Level examples:
65+
Examples of current assets.json locations:
6666

67-
- `sdk/storage/assets.json`
68-
- `sdk/storage/azure-storage-file-datalake/assets.json`
67+
- [`sdk/data/aztables/assets.json`](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/data/aztables/assets.json)
68+
- [`sdk/keyvault/azure-keyvault-keys/assets.json`](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-keys/assets.json)
6969

7070
The location of the actual test code is referred to as the `language repo`.
7171

eng/common/testproxy/transition-scripts/generate-assets-json.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ if ($UseTestRepo) {
7272
# 3. ios
7373
$LangRecordingDirs = @{"cpp" = "recordings";
7474
"go" = "recordings";
75-
"java" = "session-records";
75+
"java" = "src.*?session-records";
7676
"js" = "recordings";
7777
"net" = "SessionRecords";
7878
"python" = "recordings";
@@ -321,8 +321,8 @@ Function Move-AssetsFromLangRepo {
321321
)
322322
$filter = $LangRecordingDirs[$language]
323323
Write-Host "Language recording directory name=$filter"
324-
Write-Host "Get-ChildItem -Recurse -Filter ""*.json"" | Where-Object { `$_.DirectoryName.Split([IO.Path]::DirectorySeparatorChar) -contains ""$filter"" }"
325-
$filesToMove = Get-ChildItem -Recurse -Filter "*.json" | Where-Object { $_.DirectoryName.Split([IO.Path]::DirectorySeparatorChar) -contains "$filter" }
324+
Write-Host "Get-ChildItem -Recurse -Filter ""*.json"" | Where-Object { if ($filter.Contains(""*"")) { $_.DirectoryName -match $filter } else { $_.DirectoryName.Split([IO.Path]::DirectorySeparatorChar) -contains ""$filter"" }"
325+
$filesToMove = Get-ChildItem -Recurse -Filter "*.json" | Where-Object { if ($filter.Contains("*")) { $_.DirectoryName -match $filter } else { $_.DirectoryName.Split([IO.Path]::DirectorySeparatorChar) -contains "$filter" } }
326326
[string] $currentDir = Get-Location
327327

328328
foreach ($fromFile in $filesToMove) {

0 commit comments

Comments
 (0)