Skip to content

Commit 8408fcd

Browse files
committed
Minor UT fixes
1 parent 74bbcc0 commit 8408fcd

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Tests/GitHubGists.tests.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ try
309309
}
310310

311311
AfterAll {
312-
Remove-Item -Path $tempPath -Recurse -ErrorAction SilentlyContinue -Force
312+
if (Get-Variable -Name tempPath -ErrorAction SilentlyContinue)
313+
{
314+
Remove-Item -Path $tempPath -Recurse -ErrorAction SilentlyContinue -Force
315+
}
313316
}
314317

315318
Context 'Download gist content' {

Tests/GitHubRepositories.tests.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,11 @@ try
13631363
Describe 'GitHubRepositories\Disable-GitHubRepositoryVulnerabilityAlert' {
13641364
BeforeAll {
13651365
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid)
1366+
1367+
# The CI build has been unreliable with this test.
1368+
# Adding a short sleep to ensure successive queries reflect updated state.
1369+
Start-Sleep -Seconds $script:defaultSleepSecondsForReliability
1370+
13661371
Enable-GitHubRepositoryVulnerabilityAlert -Uri $repo.svn_url
13671372
}
13681373

@@ -1402,6 +1407,11 @@ try
14021407
Describe 'GitHubRepositories\Disable-GitHubRepositorySecurityFix' {
14031408
BeforeAll {
14041409
$repo = New-GitHubRepository -RepositoryName ([Guid]::NewGuid().Guid)
1410+
1411+
# The CI build has been unreliable with this test.
1412+
# Adding a short sleep to ensure successive queries reflect updated state.
1413+
Start-Sleep -Seconds $script:defaultSleepSecondsForReliability
1414+
14051415
Enable-GitHubRepositorySecurityFix -Uri $repo.svn_url
14061416
}
14071417

0 commit comments

Comments
 (0)