Created
May 10, 2017 14:56
-
-
Save m-malkowski/67d63d9befee1b77d91d37280e3be130 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| [string] | |
| $ResultsFile, | |
| [string] | |
| $ResultsType = "mstest" | |
| ) | |
| $ResultsFile = Resolve-Path $ResultsFile | |
| $Url = "https://ci.appveyor.com/api/testresults/$ResultsType/$($env:APPVEYOR_JOB_ID)" | |
| if(-Not (Test-Path $ResultsFile)) | |
| { | |
| Write-Host "File '$ResultsFile' not found" | |
| exit(1) | |
| } | |
| # upload results to AppVeyor | |
| try | |
| { | |
| $wc = New-Object 'System.Net.WebClient' | |
| $wc.UploadFile($Url, $ResultsFile) | |
| Write-Host "Tests result uploaded correctly to $($Url)" | |
| } | |
| catch | |
| { | |
| Write-Host "Error uploading tests results to $Url" | |
| $Exception = $_.Exception | |
| while($null -ne $Exception) | |
| { | |
| Write-Host "Error: $($Exception.Message)" | |
| $Exception = $Exception.InnerException | |
| } | |
| exit(2) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment