File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,4 @@ build: false
16
16
17
17
# Kick off the CI/CD pipeline
18
18
test_script :
19
- - ps : |
20
- . .\build.ps1 -Task Test
21
- (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path '.\TestsResults-Mod.xml'))
22
- (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path '.\TestsResults-Meta.xml'))
19
+ - ps : . .\build.ps1 -Task Test
Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ task Pester-Meta -Depends Init {
42
42
43
43
$testResultsFile = " $projectRoot \TestResults-Meta.xml"
44
44
$testResults = Invoke-Pester - Path $metaTests - PassThru - OutputFormat NUnitXml - OutputFile $testResultsFile
45
+ # If in AppVeyor, upload test results
46
+ if ($env: BHBuildSystem -eq ' AppVeyor' ) {
47
+ (New-Object ' System.Net.WebClient' ).UploadFile(" https://ci.appveyor.com/api/testresults/nunit/$ ( $env: APPVEYOR_JOB_ID ) " , " $ProjectRoot \$testResultsFile " )
48
+ }
45
49
if ($testResults.FailedCount -gt 0 ) {
46
50
$testResults | Format-List
47
51
Write-Error - Message ' One or more Pester tests failed. Build cannot continue!'
@@ -57,6 +61,10 @@ task Pester-Module -depends Init {
57
61
58
62
$testResultsFile = " $projectRoot \TestResults-Module.xml"
59
63
$testResults = Invoke-Pester - Path $unitTests - PassThru - OutputFormat NUnitXml - OutputFile $testResultsFile
64
+ # If in AppVeyor, upload test results
65
+ if ($env: BHBuildSystem -eq ' AppVeyor' ) {
66
+ (New-Object ' System.Net.WebClient' ).UploadFile(" https://ci.appveyor.com/api/testresults/nunit/$ ( $env: APPVEYOR_JOB_ID ) " , " $ProjectRoot \$testResultsFile " )
67
+ }
60
68
if ($testResults.FailedCount -gt 0 ) {
61
69
$testResults | Format-List
62
70
Write-Error - Message ' One or more Pester tests failed. Build cannot continue!'
You can’t perform that action at this time.
0 commit comments