Skip to content

Commit 6aee945

Browse files
test: scope integration AfterAll cleanup to contexts the suite creates
The Integration AfterAll disconnected every stored Confluence context via Get-ConfluenceContext -ListAvailable, which would delete a contributor's unrelated contexts when the integration tests run locally. Limit cleanup to the 'ci' and 'ci-secondary' contexts this suite creates (review thread on tests L159).
1 parent d288e61 commit 6aee945

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/Confluence.Tests.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ Describe 'Confluence' {
154154
}
155155

156156
AfterAll {
157-
Get-ConfluenceContext -ListAvailable | ForEach-Object { Disconnect-Confluence -Name $_.Name -ErrorAction SilentlyContinue }
157+
# Only remove the contexts this suite created ('ci' and, if a test left it behind,
158+
# 'ci-secondary'); never disconnect a contributor's other stored Confluence contexts
159+
# when the integration tests are run locally.
160+
foreach ($contextName in 'ci', 'ci-secondary') {
161+
Disconnect-Confluence -Name $contextName -ErrorAction SilentlyContinue
162+
}
158163
Write-Host ('-' * 60)
159164
}
160165

0 commit comments

Comments
 (0)