mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Handle error and retry test results push.
This commit is contained in:
1 parent
89b3970cfa
commit
f8520e06b3
1 file changed
+31
@@ -36,8 +36,39 @@ function Update-AppVeyorTestResults
|
||||
|
||||
if($env:Appveyor)
|
||||
{
|
||||
$retryCount = 0
|
||||
$pushedResults = $false
|
||||
$pushedArtifacts = $false
|
||||
while( (!$pushedResults -or !$pushedResults) -and $retryCount -lt 3)
|
||||
{
|
||||
if($retryCount -gt 0)
|
||||
{
|
||||
Write-Verbose "Retrying updating test artifacts..."
|
||||
}
|
||||
|
||||
$retryCount++
|
||||
$resolvedResultsPath = (Resolve-Path $resultsFile)
|
||||
try {
|
||||
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", $resolvedResultsPath)
|
||||
$pushedResults = $true
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Pushing test result failed..."
|
||||
}
|
||||
|
||||
try {
|
||||
Push-AppveyorArtifact $resolvedResultsPath
|
||||
$pushedArtifacts = $true
|
||||
}
|
||||
catch {
|
||||
Write-Warning "Pushing test Artifact failed..."
|
||||
}
|
||||
}
|
||||
|
||||
if(!$pushedResults -or !$pushedResults)
|
||||
{
|
||||
Write-Warning "Failed to push all artifacts for $resultsFile"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user