File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,14 @@ function Invoke-AppveyorTest {
50
50
51
51
$modulePath = $env: PSModulePath.Split ([System.IO.Path ]::PathSeparator) | Where-Object { Test-Path $_ } | Select-Object - First 1
52
52
Copy-Item " ${CheckoutPath} \out\PSScriptAnalyzer" " $modulePath \" - Recurse - Force
53
- $testResultsFile = " .\ TestResults.xml"
53
+ $testResultsPath = Join-Path ${CheckoutPath} TestResults.xml
54
54
$testScripts = " ${CheckoutPath} \Tests\Engine" , " ${CheckoutPath} \Tests\Rules" , " ${CheckoutPath} \Tests\Documentation"
55
- $testResults = Invoke-Pester - Script $testScripts - OutputFormat NUnitXml - OutputFile $testResultsFile - PassThru
56
- (New-Object ' System.Net.WebClient' ).UploadFile(" https://ci.appveyor.com/api/testresults/nunit/${env: APPVEYOR_JOB_ID} " , (Resolve-Path $testResultsFile ))
55
+ $uploadUrl = " https://ci.appveyor.com/api/testresults/nunit/${env: APPVEYOR_JOB_ID} "
56
+ $testResults = Invoke-Pester - Script $testScripts - OutputFormat NUnitXml - OutputFile $testResultsPath - PassThru
57
+ Write-Verbose - Verbose " Uploading test results '$testResultsPath ' to '${uploadUrl} '"
58
+ $response = (New-Object ' System.Net.WebClient' ).UploadFile(" $uploadUrl " , $testResultsPath )
59
+ $responseString = [System.Text.Encoding ]::ASCII.GetString($response )
60
+ Write-Verbose - Verbose (" Response: ({0} bytes) ${responseString} " -f $response.Count )
57
61
if ($testResults.FailedCount -gt 0 ) {
58
62
throw " $ ( $testResults.FailedCount ) tests failed."
59
63
}
You can’t perform that action at this time.
0 commit comments