Skip to content

Commit

Permalink
Merge pull request chocolatey#3249 from corbob/fix-push-tests
Browse files Browse the repository at this point in the history
(tests) Clear HTTP Cache before getting packages
  • Loading branch information
gep13 authored Jul 12, 2023
2 parents 9c470f1 + e52ea78 commit e649243
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/chocolatey-tests/commands/choco-push.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Describe 'choco push nuget <_> repository' -Tag Chocolatey, PushCommand -Skip:($
}

$Output = Invoke-Choco push $PackagePath --source $RepositoryToUse$RepositoryEndpoint @KeyParameter

Invoke-Choco cache remove
$VerifyPackagesSplat = @(
"--pre"
"--source"
Expand All @@ -172,15 +172,7 @@ Describe 'choco push nuget <_> repository' -Tag Chocolatey, PushCommand -Skip:($
"--version"
"$VersionUnderTest-$AddedVersion"
)

# Nexus can take a moment to index the package, but we want to validate that it was successfully pushed
$Timer = [System.Diagnostics.Stopwatch]::StartNew()
while ($Timer.Elapsed.TotalSeconds -lt 300 -and -not (
$Packages = (Invoke-Choco find $PackageUnderTest @VerifyPackagesSplat --Limit-Output).Lines | ConvertFrom-ChocolateyOutput -Command List
)) {
Write-Verbose "$($PackageUnderTest) was not found on $($RepositoryToUse)$($RepositoryEndpoint). Waiting for 5 seconds before trying again."
Start-Sleep -Seconds 5
}
$Packages = (Invoke-Choco find $PackageUnderTest @VerifyPackagesSplat --Limit-Output).Lines | ConvertFrom-ChocolateyOutput -Command List
}

AfterAll {
Expand Down

0 comments on commit e649243

Please sign in to comment.