Skip to content

Commit 5a7099c

Browse files
authored
Resolving Failing DataMovement Tests (Azure#48458)
* during pullrequest invocations, restore all the assets.json files prior to invoking tests
1 parent 4df6cdc commit 5a7099c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

eng/pipelines/templates/jobs/ci.tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ jobs:
125125
- template: /eng/pipelines/templates/steps/set-artifact-packages.yml
126126
parameters:
127127
PackageInfo: '$(Build.SourcesDirectory)/PackageInfo'
128+
Restore: true
128129

129130
- pwsh: |
130131
if ("$(ProjectNames)" -like "*storage*") {

eng/pipelines/templates/steps/set-artifact-packages.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ parameters:
22
PackageInfo: ''
33
Artifacts: []
44
IncludeIndirect: true
5+
Restore: false
56
steps:
67
# Package-Properties folder contains the package properties for all discovered packages that were either A) affected by the PR or
78
# B) explicitly present in the service directory. This repo splits the builds into two categories: "mgmt" and "dataplane". While
@@ -49,3 +50,26 @@ steps:
4950
displayName: Resolve Service and Project List
5051
condition: ne(variables['ProjectNames'], '')
5152
53+
- ${{ if eq(parameters.Restore, true) }}:
54+
- template: /eng/common/testproxy/test-proxy-tool.yml
55+
parameters:
56+
runProxy: false
57+
58+
- pwsh: |
59+
$packageProperties = Get-ChildItem -Recurse '${{ parameters.PackageInfo }}' -Filter *.json `
60+
| Foreach-Object { Get-Content -Raw -Path $_.FullName | ConvertFrom-Json }
61+
$packageSet = "$(ProjectNames)" -split ","
62+
$changedProjects = $packageProperties | Where-Object { $packageSet -contains $_.ArtifactName }
63+
64+
foreach ($proj in $changedProjects) {
65+
$assets = Join-Path (Join-Path "$(Build.SourcesDirectory)" $proj.DirectoryPath) "assets.json"
66+
if (Test-Path $assets) {
67+
Write-Host "Restoring $assets"
68+
if ($IsWindows) {
69+
& "$(Build.BinariesDirectory)/test-proxy/test-proxy.exe" restore -a $assets
70+
} else {
71+
& "$(Build.BinariesDirectory)/test-proxy/test-proxy" restore -a $assets
72+
}
73+
}
74+
}
75+
displayName: Restore Recordings

0 commit comments

Comments
 (0)