Skip to content

Commit 48dd4d5

Browse files
fix: Remove unnecessary Push-Location and Pop-Location calls in BeforeAll and AfterAll scripts for cleaner execution flow
1 parent deded99 commit 48dd4d5

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,12 @@ jobs:
212212
213213
Write-Host "Running BeforeAll setup script: $beforeAllScript"
214214
try {
215-
Push-Location 'tests'
216215
& $beforeAllScript
217216
Write-Host "BeforeAll script completed successfully: $beforeAllScript"
218-
}
219-
catch {
217+
} catch {
220218
Write-Error "BeforeAll script failed: $beforeAllScript - $_"
221219
throw
222220
}
223-
finally {
224-
Pop-Location
225-
}
226221
}
227222
228223
Test-ModuleLocal:
@@ -285,17 +280,12 @@ jobs:
285280
286281
Write-Host "Running AfterAll teardown script: $afterAllScript"
287282
try {
288-
Push-Location 'tests'
289283
& $afterAllScript
290284
Write-Host "AfterAll script completed successfully: $afterAllScript"
291-
}
292-
catch {
285+
} catch {
293286
Write-Warning "AfterAll script failed: $afterAllScript - $_"
294287
# Don't throw for teardown scripts to ensure other cleanup scripts can run
295288
}
296-
finally {
297-
Pop-Location
298-
}
299289
}
300290
301291
Get-TestResults:

.github/workflows/workflow.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,12 @@ jobs:
214214
215215
Write-Host "Running BeforeAll setup script: $beforeAllScript"
216216
try {
217-
Push-Location 'tests'
218217
& $beforeAllScript
219218
Write-Host "BeforeAll script completed successfully: $beforeAllScript"
220-
}
221-
catch {
219+
} catch {
222220
Write-Error "BeforeAll script failed: $beforeAllScript - $_"
223221
throw
224222
}
225-
finally {
226-
Pop-Location
227-
}
228223
}
229224
230225
Test-ModuleLocal:
@@ -287,17 +282,12 @@ jobs:
287282
288283
Write-Host "Running AfterAll teardown script: $afterAllScript"
289284
try {
290-
Push-Location 'tests'
291285
& $afterAllScript
292286
Write-Host "AfterAll script completed successfully: $afterAllScript"
293-
}
294-
catch {
287+
} catch {
295288
Write-Warning "AfterAll script failed: $afterAllScript - $_"
296289
# Don't throw for teardown scripts to ensure other cleanup scripts can run
297290
}
298-
finally {
299-
Pop-Location
300-
}
301291
}
302292
303293
Get-TestResults:

0 commit comments

Comments
 (0)