@@ -13,7 +13,10 @@ param (
1313
1414 [Parameter ()]
1515 [ValidateSet (' Unit' , ' Integration' )]
16- [string []] $Type = @ (' Unit' , ' Integration' )
16+ [string []] $Type = @ (' Unit' , ' Integration' ),
17+
18+ [Parameter ()]
19+ [switch ] $Download = $env: APPVEYOR -eq ' true'
1720)
1821
1922if (-not $Configuration ) {
@@ -75,7 +78,13 @@ if ($Type -contains 'Unit')
7578if ($Type -contains ' Integration' )
7679{
7780 # Run docker integration tests.
78- if (get-command docker- compose - ea SilentlyContinue) {
81+ $cmd = (get-command docker- compose - ea SilentlyContinue).Path
82+ if (-not $cmd -and $Download ) {
83+ invoke-webrequest ' https://github.com/docker/compose/releases/download/1.11.2/docker-compose-Windows-x86_64.exe' - outfile " ${env: TEMP} \docker-compose.exe"
84+ $cmd = " ${env: TEMP} \docker-compose.exe"
85+ }
86+
87+ if ($cmd ) {
7988 [string ] $path = if ($env: APPVEYOR -eq ' true' ) {
8089 $no_tty = ' -T'
8190 resolve-path " $PSScriptRoot \..\docker\appveyor\docker-compose.yml"
@@ -88,7 +97,7 @@ if ($Type -contains 'Integration')
8897 }
8998
9099 write-verbose " Running tests in '$path '"
91- docker - compose -f " $path " $verbose run $no_tty -- rm test - c Invoke-Pester C:\Tests - EnableExit - OutputFile C:\Tests\Results.xml - OutputFormat NUnitXml
100+ & $cmd -f " $path " $verbose run $no_tty -- rm test - c Invoke-Pester C:\Tests - EnableExit - OutputFile C:\Tests\Results.xml - OutputFormat NUnitXml
92101 if (-not $? ) {
93102 $Failed = $true
94103 }
@@ -101,6 +110,8 @@ if ($Type -contains 'Integration')
101110 $wc = new-object System.Net.WebClient
102111 $wc.UploadFile ($url , $path )
103112 }
113+ } else {
114+ write-warning ' Failed to find docker-compose; integration tests will not be performed.'
104115 }
105116
106117 if ($Failed ) {
0 commit comments