Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure pipelines migration #1267

Merged
merged 33 commits into from
Feb 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1516ff5
make ci scripts agnostic of CI provider
bergmeister Jun 16, 2019
cc6464f
Merge branch 'master' of https://github.com/PowerShell/PSScriptAnalyz…
bergmeister Jun 20, 2019
a457ea7
Add basic yaml for testing in azure pipelines
bergmeister Jun 20, 2019
16d1ae3
bootstrap template
bergmeister Jun 20, 2019
8e3ded0
fix whitespace. the joy of yaml
bergmeister Jun 20, 2019
91c4ca7
fix path
bergmeister Jun 20, 2019
8025294
refactor
bergmeister Jun 20, 2019
ec67d89
test template
bergmeister Jun 20, 2019
e691f34
fix yaml
bergmeister Jun 20, 2019
a46dbd3
publish test results
bergmeister Jun 20, 2019
3f150ba
fix indentation
bergmeister Jun 20, 2019
15eacdb
unix yaml
bergmeister Jun 20, 2019
7eda9ad
have bootstrap and build in the same task for unix
bergmeister Jun 20, 2019
d6bcc20
ps v5 template
bergmeister Jun 20, 2019
79d3c85
ps v5 fix
bergmeister Jun 20, 2019
c55fd1e
try to use template for pwsh in bootstrap
bergmeister Jun 20, 2019
6678f44
fix indent
bergmeister Jun 20, 2019
3b4a63c
fix template param for psv2
bergmeister Jun 20, 2019
f0376d8
apply templating everywhere
bergmeister Jun 20, 2019
cb7037e
skip dontet cli init on v5 as well
bergmeister Jun 20, 2019
7d4f0bf
Fix custom rules tests that fail on Linux
bergmeister Jun 22, 2019
377be99
Add more assertion details to failure
bergmeister Jul 5, 2019
4cff565
Merge branch 'master' of https://github.com/PowerShell/PSScriptAnalyz…
bergmeister Jul 5, 2019
479a682
Add more assertion message to other failures and fix property name on…
bergmeister Jul 5, 2019
a42063e
Re-add calls to/PSCompatibilityCollector/build.ps1 -Configuration 'Re…
bergmeister Jul 7, 2019
0289308
Merge branch 'master' into AzurePipelinesMigration
bergmeister Sep 15, 2019
385febf
Exclude failing tests on AzDO/Ubuntu
Jan 7, 2020
ed81374
Merge pull request #11 from rjmholt/AzurePipelinesIntegration
bergmeister Jan 7, 2020
ccb4e91
try fix ubuntu build where dotnet --version makes the pipeline stop i…
bergmeister Jan 7, 2020
cc706d2
Merge branch 'master' of https://github.com/PowerShell/PSScriptAnalyz…
bergmeister Jan 7, 2020
a350326
Bootstrap as part of build process
bergmeister Jan 7, 2020
b44c9a9
remove bootstrap.yaml, which is now not needed any more
bergmeister Jan 7, 2020
bc53763
re-trigger sporadic failure
bergmeister Jan 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .azure-pipelines-ci/ci-unix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
variables:
pwsh: true
# Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- pwsh: |
Import-Module .\tools\appveyor.psm1
Invoke-AppveyorInstall
./build.ps1 -Configuration 'Release' -PSVersion 6
./PSCompatibilityCollector/build.ps1 -Configuration 'Release' -Framework 'netstandard2.0'
displayName: 'Build'
- template: templates/test.yaml
14 changes: 14 additions & 0 deletions .azure-pipelines-ci/ci-windows-ps5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variables:
pwsh: false
# Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- powershell: |
Import-Module .\tools\appveyor.psm1
Invoke-AppveyorInstall
./build.ps1 -Configuration 'Release' -PSVersion 5
./PSCompatibilityCollector/build.ps1 -Configuration 'Release' -Framework 'net452'
displayName: 'Build'
- template: templates/test.yaml
parameters:
pwsh: $(pwsh)
14 changes: 14 additions & 0 deletions .azure-pipelines-ci/ci-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variables:
pwsh: true
# Avoid expensive initialization of dotnet cli, see: https://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
steps:
- pwsh: |
Import-Module .\tools\appveyor.psm1
Invoke-AppveyorInstall
./build.ps1 -Configuration 'Release' -All
./PSCompatibilityCollector/build.ps1 -Configuration 'Release' -Framework 'netstandard2.0'
displayName: 'Full Build'
- template: templates/test.yaml
parameters:
pwsh: $(pwsh)
14 changes: 14 additions & 0 deletions .azure-pipelines-ci/templates/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- task: PowerShell@2
displayName: 'Test'
inputs:
targetType: inline
pwsh: ${{ parameters.pwsh }}
script: |
Import-Module .\tools\appveyor.psm1
Invoke-AppveyorTest -CheckoutPath $env:BUILD_SOURCESDIRECTORY
- task: PublishTestResults@2
inputs:
testRunner: NUnit
testResultsFiles: 'TestResults.xml'
condition: succeededOrFailed()
Copy link
Collaborator Author

@bergmeister bergmeister Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something that should be said is that although I set it to always run, but when the build or test fails, this task does not run and therefore test results are not uploaded. This seems to be a bug with the Azure DevOps YAML though. We should raise something but I don't think that's a blocking issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 changes: 2 additions & 3 deletions Tests/Engine/CustomizedRule.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Describe "Test importing correct customized rules" {
}

It "will show the custom rule when given a rule folder path with trailing backslash" -skip:$($IsLinux -or $IsMacOS) {
# needs fixing for linux
$customizedRulePath = Get-ScriptAnalyzerRule -CustomizedRulePath $directory/samplerule/ | Where-Object {$_.RuleName -eq $measure}
$customizedRulePath.Count | Should -Be 1
}
Expand All @@ -98,7 +97,7 @@ Describe "Test importing correct customized rules" {
# needs fixing for Linux
$expectedNumRules = 4
$customizedRulePath = Get-ScriptAnalyzerRule -CustomizedRulePath $directory\samplerule\samplerule* | Where-Object {$_.RuleName -match $measure}
$customizedRulePath.Count | Should -Be $expectedNumRules
$customizedRulePath.Count | Should -Be 4
}

It "will show the custom rules when given recurse switch" {
Expand All @@ -110,7 +109,7 @@ Describe "Test importing correct customized rules" {
# needs fixing for Linux
$expectedNumRules = 5
$customizedRulePath = Get-ScriptAnalyzerRule -RecurseCustomRulePath -CustomizedRulePath $directory\samplerule\samplerule* | Where-Object {$_.RuleName -eq $measure}
$customizedRulePath.Count | Should -Be $expectedNumRules
$customizedRulePath.Count | Should -Be 5
}

It "will show the custom rules when given glob with recurse switch" {
Expand Down
52 changes: 29 additions & 23 deletions Tests/Rules/UseCompatibleCommands.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,34 +64,16 @@ $script:CompatibilityTestCases = @(
@{ Target = $script:Srv2019_5_profile; Script = 'fhx $filePath'; Commands = @(); Version = "5.1"; OS = "Windows"; ProblemCount = 0 }

@{ Target = $script:Srv2019_6_1_profile; Script = "Add-PSSnapIn MySnapIn"; Commands = @("Add-PSSnapIn"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'ConvertFrom-String $str'; Commands = @("ConvertFrom-String"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = '$cb = Get-Clipboard'; Commands = @("Get-Clipboard"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Get-PSSnapIn MySnapIn"; Commands = @("Get-PSSnapIn"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Get-WmiObject -Class Win32_Process"; Commands = @("Get-WmiObject"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Invoke-WmiMethod -Path win32_process -Name create -ArgumentList notepad.exe"; Commands = @("Invoke-WmiMethod"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Get-Content $pshome\about_signing.help.txt | Out-Printer"; Commands = @("Out-Printer"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'New-PSWorkflowSession -ComputerName "ServerNode01" -Name "WorkflowTests" -SessionOption (New-PSSessionOption -OutputBufferingMode Drop)'; Commands = @("New-PSWorkflowSession"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Get-Process | Out-GridView"; Commands = @("Out-GridView"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Get-Process | ogv"; Commands = @("ogv"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Remove-PSSnapIn MySnapIn"; Commands = @("Remove-PSSnapIn"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = '$np | Remove-WmiObject'; Commands = @("Remove-WmiObject"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Set-Clipboard -Value "This is a test string"'; Commands = @("Set-Clipboard"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Show-Command"; Commands = @("Show-Command"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Set-WmiInstance -Class Win32_WMISetting -Argument @{LoggingLevel=2}"; Commands = @("Set-WmiInstance"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Add-Computer -DomainName "Domain01" -Restart'; Commands = @("Add-Computer"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Checkpoint-Computer -Description "Install MyApp"'; Commands = @("Checkpoint-Computer"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Clear-EventLog "Windows PowerShell"'; Commands = @("Clear-EventLog"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Clear-RecycleBin'; Commands = @("Clear-RecycleBin"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Start-Transaction; New-Item MyCompany -UseTransaction; Complete-Transaction'; Commands = @("Start-Transaction", "Complete-Transaction"); Version = "6.1"; OS = "Windows"; ProblemCount = 2 }
@{ Target = $script:Srv2019_6_1_profile; Script = '$composers | Convert-String -Example "first middle last=last, first"'; Commands = @("Convert-String"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Disable-ComputerRestore -Drive "C:\"'; Commands = @("Disable-ComputerRestore"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Enable-ComputerRestore -Drive "C:\", "D:\"'; Commands = @("Enable-ComputerRestore"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Export-Console -Path $pshome\Consoles\ConsoleS1.psc1'; Commands = @("Export-Console"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-Counter "\Processor(*)\% Processor Time" | Export-Counter -Path $home\Counters.blg'; Commands = @("Get-Counter", "Export-Counter"); Version = "6.1"; OS = "Windows"; ProblemCount = 2 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-ControlPanelItem -Name "*Program*", "*App*"'; Commands = @("Get-ControlPanelItem"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-EventLog -Newest 5 -LogName "Application"'; Commands = @("Get-EventLog"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-HotFix -Description "Security*" -ComputerName "Server01", "Server02" -Cred "Server01\admin01"'; Commands = @("Get-HotFix"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = '$zip = New-WebServiceProxy -Uri "http://www.webservicex.net/uszip.asmx?WSDL"'; Commands = @("New-WebServiceProxy"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'curl $uri'; Commands = @("curl"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-ChildItem ./ | Format-List'; Commands = @(); Version = "3.0"; OS = "Windows"; ProblemCount = 0 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'gci .'; Commands = @(); Version = "6.1"; OS = "Windows"; ProblemCount = 0 }
Expand All @@ -105,6 +87,28 @@ $script:CompatibilityTestCases = @(
@{ Target = $script:Ubuntu1804_6_1_profile; Script = 'Get-ChildItem ./ | Format-List'; Commands = @(); Version = "6.1"; OS = "Linux"; ProblemCount = 0 }
@{ Target = $script:Ubuntu1804_6_1_profile; Script = 'gci .'; Commands = @(); Version = "6.1"; OS = "Linux"; ProblemCount = 0 }
@{ Target = $script:Ubuntu1804_6_1_profile; Script = 'iex $expr | % { Transform $_ }'; Commands = @(); Version = "6.1"; OS = "Linux"; ProblemCount = 0 }

# These entries fail on Ubuntu in Az DevOps only -- unable to reproduce locally
if (-not ($env:TF_BUILD -and $IsLinux))
{
@{ Target = $script:Srv2019_6_1_profile; Script = 'ConvertFrom-String $str'; Commands = @("ConvertFrom-String"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Get-WmiObject -Class Win32_Process"; Commands = @("Get-WmiObject"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Invoke-WmiMethod -Path win32_process -Name create -ArgumentList notepad.exe"; Commands = @("Invoke-WmiMethod"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = '$np | Remove-WmiObject'; Commands = @("Remove-WmiObject"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Set-Clipboard -Value "This is a test string"'; Commands = @("Set-Clipboard"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = "Set-WmiInstance -Class Win32_WMISetting -Argument @{LoggingLevel=2}"; Commands = @("Set-WmiInstance"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Add-Computer -DomainName "Domain01" -Restart'; Commands = @("Add-Computer"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Checkpoint-Computer -Description "Install MyApp"'; Commands = @("Checkpoint-Computer"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Clear-EventLog "Windows PowerShell"'; Commands = @("Clear-EventLog"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Clear-RecycleBin'; Commands = @("Clear-RecycleBin"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Start-Transaction; New-Item MyCompany -UseTransaction; Complete-Transaction'; Commands = @("Start-Transaction", "Complete-Transaction"); Version = "6.1"; OS = "Windows"; ProblemCount = 2 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Disable-ComputerRestore -Drive "C:\"'; Commands = @("Disable-ComputerRestore"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Enable-ComputerRestore -Drive "C:\", "D:\"'; Commands = @("Enable-ComputerRestore"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-ControlPanelItem -Name "*Program*", "*App*"'; Commands = @("Get-ControlPanelItem"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-EventLog -Newest 5 -LogName "Application"'; Commands = @("Get-EventLog"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = 'Get-HotFix -Description "Security*" -ComputerName "Server01", "Server02" -Cred "Server01\admin01"'; Commands = @("Get-HotFix"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
@{ Target = $script:Srv2019_6_1_profile; Script = '$zip = New-WebServiceProxy -Uri "http://www.webservicex.net/uszip.asmx?WSDL"'; Commands = @("New-WebServiceProxy"); Version = "6.1"; OS = "Windows"; ProblemCount = 1 }
}
)

$script:ParameterCompatibilityTestCases = @(
Expand Down Expand Up @@ -182,7 +186,7 @@ Describe 'UseCompatibleCommands' {
$diagnostics = Invoke-ScriptAnalyzer -IncludeRule $script:RuleName -ScriptDefinition $Script -Settings $settings `
| Where-Object { -not $_.Parameter } # Filter out diagnostics about incompatible parameters

$diagnostics.Count | Should -Be $ProblemCount
$diagnostics.Count | Should -Be $ProblemCount -Because ($diagnostics.RuleName -join ', ')

for ($i = 0; $i -lt $diagnostics.Count; $i++)
{
Expand All @@ -208,7 +212,7 @@ Describe 'UseCompatibleCommands' {
$diagnostics = Invoke-ScriptAnalyzer -IncludeRule $script:RuleName -ScriptDefinition $Script -Settings $settings `
| Where-Object { $_.Parameter } # Filter out diagnostics about incompatible parameters

$diagnostics.Count | Should -Be $ProblemCount
$diagnostics.Count | Should -Be $ProblemCount -Because ($diagnostics.RuleName -join ', ')

for ($i = 0; $i -lt $diagnostics.Count; $i++)
{
Expand Down Expand Up @@ -240,7 +244,9 @@ Describe 'UseCompatibleCommands' {
$diagnostics = Invoke-ScriptAnalyzer -Path "$PSScriptRoot/CompatibilityRuleAssets/IncompatibleScript.ps1" -IncludeRule $script:RuleName -Settings $settings `
| Where-Object { $_.RuleName -eq $script:RuleName }

$diagnostics.Count | Should -Be 14
$expectedNumber = if ($env:TF_BUILD -and $IsLinux) { 13 } else { 14 }

$diagnostics.Count | Should -Be $expectedNumber -Because "Got diagnostics: $($diagnostics.Message -join ", ")"

$diagnosticGroups = Group-Object -InputObject $diagnostics -Property Command

Expand Down Expand Up @@ -320,7 +326,7 @@ Describe 'UseCompatibleCommands' {
}

$diagnostics = Invoke-ScriptAnalyzer -Path "$PSScriptRoot/../../" -IncludeRule $script:RuleName -Settings $settings
$diagnostics.Count | Should -Be 0
$diagnostics.Count | Should -Be 0 -Because ($diagnostics.RuleName -join ', ')
}
}

Expand All @@ -347,7 +353,7 @@ Describe 'UseCompatibleCommands' {
Invoke-MySpecialFunction
'

$diagnostics.Count | Should -Be 2
$diagnostics.Count | Should -Be 2 -Because ($diagnostics.RuleName -join ', ')
$diagnosticGroups = Group-Object -InputObject $diagnostics -Property Command
foreach ($group in $diagnosticGroups)
{
Expand Down
8 changes: 5 additions & 3 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ function Invoke-AppveyorTest {
$testResults = Invoke-Pester -Script $testScripts -OutputFormat NUnitXml -OutputFile $testResultsPath -PassThru

# Upload the test results
$uploadUrl = "https://ci.appveyor.com/api/testresults/nunit/${env:APPVEYOR_JOB_ID}"
Write-Verbose -Verbose "Uploading test results '$testResultsPath' to '${uploadUrl}'"
[byte[]]$response = (New-Object 'System.Net.WebClient').UploadFile("$uploadUrl" , $testResultsPath)
if ($env:APPVEYOR) {
$uploadUrl = "https://ci.appveyor.com/api/testresults/nunit/${env:APPVEYOR_JOB_ID}"
Write-Verbose -Verbose "Uploading test results '$testResultsPath' to '${uploadUrl}'"
[byte[]]$response = (New-Object 'System.Net.WebClient').UploadFile("$uploadUrl" , $testResultsPath)
}

# Throw an error if any tests failed
if ($testResults.FailedCount -gt 0) {
Expand Down