Skip to content

Commit f4e93d9

Browse files
authored
chore: renumber round-trip delete-unmatched and teardown phases
1 parent 2fb3b5a commit f4e93d9

5 files changed

Lines changed: 27 additions & 27 deletions

File tree

.github/workflows/integration-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
-TargetApimName '${{ steps.phase1.outputs.targetApimName }}' `
233233
-LogLevel '${{ steps.settings.outputs.logLevel }}'
234234
235-
- name: Run Round-Trip Phase 6b (Delete Unmatched)
235+
- name: Run Round-Trip Phase 7 (Delete Unmatched)
236236
if: success()
237237
shell: pwsh
238238
env:
@@ -241,15 +241,15 @@ jobs:
241241
run: |
242242
$extractOutputDir = '${{ steps.phase2.outputs.ExtractOutputDir }}'
243243
244-
./tests/integration/all-resource-types/phases/run-phase6-delete-unmatched.ps1 `
244+
./tests/integration/all-resource-types/phases/run-phase7-delete-unmatched.ps1 `
245245
-TargetSubscriptionId '${{ steps.phase1.outputs.targetSubscriptionId }}' `
246246
-TargetResourceGroup '${{ steps.phase1.outputs.targetResourceGroup }}' `
247247
-TargetApimName '${{ steps.phase1.outputs.targetApimName }}' `
248248
-OverrideFile '${{ steps.phase4.outputs.overrideFile }}' `
249249
-LogLevel '${{ steps.settings.outputs.logLevel }}' `
250250
-ExtractOutputDir $extractOutputDir
251251
252-
- name: Run Round-Trip Phase 7 (Teardown)
252+
- name: Run Round-Trip Phase 8 (Teardown)
253253
if: always()
254254
shell: pwsh
255255
run: |
@@ -262,7 +262,7 @@ jobs:
262262
$location = '${{ steps.phase1.outputs.location }}'
263263
if ([string]::IsNullOrWhiteSpace($location)) { $location = '${{ inputs.location }}' }
264264
265-
./tests/integration/all-resource-types/phases/run-phase7-teardown.ps1 `
265+
./tests/integration/all-resource-types/phases/run-phase8-teardown.ps1 `
266266
-SourceResourceGroup $sourceResourceGroup `
267267
-TargetResourceGroup $targetResourceGroup `
268268
-Location $location

tests/integration/all-resource-types/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,28 +181,28 @@ Compares source and target APIM resources and reports differences or parity.
181181
./phases/run-phase6-compare.ps1 -SourceSubscriptionId 11111111-1111-1111-1111-111111111111 -SourceResourceGroup rg-src -SourceApimName src-apim -TargetSubscriptionId 22222222-2222-2222-2222-222222222222 -TargetResourceGroup rg-tgt -TargetApimName tgt-apim -LogLevel Verbose
182182
```
183183

184-
**Phase 6b: Delete-unmatched validation** (`phases/run-phase6-delete-unmatched.ps1`).
184+
**Phase 7: Delete-unmatched validation** (`phases/run-phase7-delete-unmatched.ps1`).
185185

186186
Removes a revisioned API from extracted artifacts, runs `apiops publish --delete-unmatched`, and verifies the removed API revisions are deleted from target APIM.
187187

188188
```powershell
189189
# Minimum parameters
190-
./phases/run-phase6-delete-unmatched.ps1 -TargetResourceGroup rg-tgt -TargetApimName tgt-apim -OverrideFile ./phases/extracted-artifacts/.overrides.yaml
190+
./phases/run-phase7-delete-unmatched.ps1 -TargetResourceGroup rg-tgt -TargetApimName tgt-apim -OverrideFile ./phases/extracted-artifacts/.overrides.yaml
191191
192192
# All parameters
193-
./phases/run-phase6-delete-unmatched.ps1 -TargetSubscriptionId 22222222-2222-2222-2222-222222222222 -TargetResourceGroup rg-tgt -TargetApimName tgt-apim -LogLevel Verbose -OverrideFile ./phases/extracted-artifacts/.overrides.yaml -ExtractOutputDir ./phases/extracted-artifacts
193+
./phases/run-phase7-delete-unmatched.ps1 -TargetSubscriptionId 22222222-2222-2222-2222-222222222222 -TargetResourceGroup rg-tgt -TargetApimName tgt-apim -LogLevel Verbose -OverrideFile ./phases/extracted-artifacts/.overrides.yaml -ExtractOutputDir ./phases/extracted-artifacts
194194
```
195195

196-
**Phase 7: Teardown** (`phases/run-phase7-teardown.ps1`).
196+
**Phase 8: Teardown** (`phases/run-phase8-teardown.ps1`).
197197

198198
Deletes source and target resource groups and purges soft-deleted APIM services. This phase always run, regardless of the success of previous phases, unles `-SkipTeardown` switch is specified.
199199

200200
```powershell
201201
# Minimum parameters
202-
./phases/run-phase7-teardown.ps1 -SourceResourceGroup rg-src -TargetResourceGroup rg-tgt
202+
./phases/run-phase8-teardown.ps1 -SourceResourceGroup rg-src -TargetResourceGroup rg-tgt
203203
204204
# All parameters
205-
./phases/run-phase7-teardown.ps1 -SourceResourceGroup rg-src -TargetResourceGroup rg-tgt -Location eastus2 -SkipTeardown
205+
./phases/run-phase8-teardown.ps1 -SourceResourceGroup rg-src -TargetResourceGroup rg-tgt -Location eastus2 -SkipTeardown
206206
```
207207

208208
## CI

tests/integration/all-resource-types/phases/run-phase6-delete-unmatched.ps1 renamed to tests/integration/all-resource-types/phases/run-phase7-delete-unmatched.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#requires -Version 7.0
44
<#
55
.SYNOPSIS
6-
Phase 6b - Validate publish --delete-unmatched with revisioned APIs.
6+
Phase 7 - Validate publish --delete-unmatched with revisioned APIs.
77
.DESCRIPTION
88
Removes a revisioned API from extracted artifacts, runs publish with
99
--delete-unmatched, and verifies the revisioned API resources are deleted

tests/integration/all-resource-types/phases/run-phase7-teardown.ps1 renamed to tests/integration/all-resource-types/phases/run-phase8-teardown.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#requires -Version 7.0
44
<#
55
.SYNOPSIS
6-
Phase 7 — Tear down source and target APIM resource groups.
6+
Phase 8 — Tear down source and target APIM resource groups.
77
.DESCRIPTION
88
Deletes the source and target resource groups, waits for the deletions to complete, and then purges any soft-deleted APIM instances in the specified location.
99
@@ -20,7 +20,7 @@
2020
Skips teardown when specified.
2121
2222
.EXAMPLE
23-
.\run-phase7-teardown.ps1 -SourceResourceGroup rg-src -TargetResourceGroup rg-tgt
23+
.\run-phase8-teardown.ps1 -SourceResourceGroup rg-src -TargetResourceGroup rg-tgt
2424
#>
2525

2626
[CmdletBinding()]
@@ -49,7 +49,7 @@ if ($SkipTeardown) {
4949
exit 0
5050
}
5151

52-
Write-Host "🧹 PHASE 7 — Teardown"
52+
Write-Host "🧹 PHASE 8 — Teardown"
5353

5454
$sourceApimName = $null
5555
$targetApimName = $null

tests/integration/all-resource-types/run-roundtrip-test.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ $phase3ValidateExtractScript = Join-Path $PSScriptRoot 'phases/run-phase3-valida
116116
$phase4CreateOverridesScript = Join-Path $PSScriptRoot 'phases/run-phase4-create-overrides.ps1'
117117
$phase5PublishScript = Join-Path $PSScriptRoot 'phases/run-phase5-publish.ps1'
118118
$phase6CompareScript = Join-Path $PSScriptRoot 'phases/run-phase6-compare.ps1'
119-
$phase6bDeleteUnmatchedScript = Join-Path $PSScriptRoot 'phases/run-phase6-delete-unmatched.ps1'
120-
$phase7TeardownScript = Join-Path $PSScriptRoot 'phases/run-phase7-teardown.ps1'
119+
$phase7DeleteUnmatchedScript = Join-Path $PSScriptRoot 'phases/run-phase7-delete-unmatched.ps1'
120+
$phase8TeardownScript = Join-Path $PSScriptRoot 'phases/run-phase8-teardown.ps1'
121121

122-
foreach ($requiredFile in @($phase1DeployScript, $phase2ExtractScript, $phase3ValidateExtractScript, $phase4CreateOverridesScript, $phase5PublishScript, $phase6CompareScript, $phase6bDeleteUnmatchedScript, $phase7TeardownScript)) {
122+
foreach ($requiredFile in @($phase1DeployScript, $phase2ExtractScript, $phase3ValidateExtractScript, $phase4CreateOverridesScript, $phase5PublishScript, $phase6CompareScript, $phase7DeleteUnmatchedScript, $phase8TeardownScript)) {
123123
if (-not (Test-Path $requiredFile)) {
124124
Write-Error "Required file not found: $requiredFile"
125125
exit 2
@@ -251,18 +251,18 @@ try {
251251
exit $exitCode
252252
}
253253

254-
# Phase 6b: Validate delete-unmatched for revisioned APIs
255-
$currentPhase = 'phase6-delete-unmatched'
256-
$phase6bDeleteUnmatchedArgs = @{
254+
# Phase 7: Validate delete-unmatched for revisioned APIs
255+
$currentPhase = 'phase7-delete-unmatched'
256+
$phase7DeleteUnmatchedArgs = @{
257257
TargetResourceGroup = $TargetResourceGroup
258258
TargetApimName = $TargetApimName
259259
TargetSubscriptionId = $TargetSubscriptionId
260260
OverrideFile = $overrideFile
261261
LogLevel = $LogLevel
262262
}
263-
Add-ArgumentIfSet -Hashtable $phase6bDeleteUnmatchedArgs -Key 'ExtractOutputDir' -Value $extractOutputDirValue
263+
Add-ArgumentIfSet -Hashtable $phase7DeleteUnmatchedArgs -Key 'ExtractOutputDir' -Value $extractOutputDirValue
264264
$global:LASTEXITCODE = 0
265-
& $phase6bDeleteUnmatchedScript @phase6bDeleteUnmatchedArgs
265+
& $phase7DeleteUnmatchedScript @phase7DeleteUnmatchedArgs
266266

267267
$exitCode = $LASTEXITCODE
268268
}
@@ -278,17 +278,17 @@ catch {
278278
}
279279
}
280280
finally {
281-
# Phase 7: Teardown apim instances and supporting resources
282-
$phase7Args = @{
281+
# Phase 8: Teardown apim instances and supporting resources
282+
$phase8Args = @{
283283
SourceResourceGroup = $SourceResourceGroup
284284
TargetResourceGroup = $TargetResourceGroup
285285
Location = $Location
286286
SkipTeardown = $SkipTeardown
287287
}
288-
Add-ArgumentIfSet -Hashtable $phase7Args -Key 'SourceSubscriptionId' -Value $SourceSubscriptionId
289-
Add-ArgumentIfSet -Hashtable $phase7Args -Key 'TargetSubscriptionId' -Value $TargetSubscriptionId
288+
Add-ArgumentIfSet -Hashtable $phase8Args -Key 'SourceSubscriptionId' -Value $SourceSubscriptionId
289+
Add-ArgumentIfSet -Hashtable $phase8Args -Key 'TargetSubscriptionId' -Value $TargetSubscriptionId
290290

291-
& $phase7TeardownScript @phase7Args
291+
& $phase8TeardownScript @phase8Args
292292
}
293293

294294
exit $exitCode

0 commit comments

Comments
 (0)