diff --git a/netci.groovy b/netci.groovy index 852a9c456..31f2b29eb 100644 --- a/netci.groovy +++ b/netci.groovy @@ -8,7 +8,7 @@ import jobs.generation.Utilities; def project = GithubProject def branch = GithubBranchName -def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'CentOS7.1'] +def osList = ['Ubuntu', 'OSX', 'Windows_NT', 'Windows_2016', 'CentOS7.1'] def static getBuildJobName(def configuration, def os) { return configuration.toLowerCase() + '_' + os.toLowerCase() @@ -28,6 +28,9 @@ def static getBuildJobName(def configuration, def os) { if (os == 'Windows_NT') { buildCommand = ".\\build.cmd -Configuration ${lowerConfiguration} Default" } + else if (os == 'Windows_2016') { + buildCommand = ".\\build.cmd -Configuration ${lowerConfiguration} -RunInstallerTestsInDocker Default" + } else if (os == 'Ubuntu') { buildCommand = "./build.sh --skip-prereqs --configuration ${lowerConfiguration} --docker ubuntu Default" } @@ -39,7 +42,7 @@ def static getBuildJobName(def configuration, def os) { def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { // Set the label. steps { - if (os == 'Windows_NT') { + if (os == 'Windows_NT' || os == 'Windows_2016') { // Batch batchFile(buildCommand) } diff --git a/scripts/run-build.ps1 b/scripts/run-build.ps1 index f78681076..b28b555ac 100644 --- a/scripts/run-build.ps1 +++ b/scripts/run-build.ps1 @@ -6,6 +6,7 @@ param( [string]$Configuration="Debug", [switch]$NoPackage, + [switch]$RunInstallerTestsInDocker, [switch]$Help) if($Help) @@ -15,6 +16,7 @@ if($Help) Write-Host "Options:" Write-Host " -Configuration Build the specified Configuration (Debug or Release, default: Debug)" Write-Host " -NoPackage Skip packaging targets" + Write-Host " -RunInstallerTestsInDocker Runs the .msi installer tests in a Docker container. Requires Windows 2016 TP4 or higher" Write-Host " -Help Display this help message" Write-Host " The build targets to run (Init, Compile, Publish, etc.; Default is a full build and publish)" exit 0 @@ -31,6 +33,11 @@ else $env:DOTNET_BUILD_SKIP_PACKAGING=0 } +if ($RunInstallerTestsInDocker) +{ + $env:RunInstallerTestsInDocker=1 +} + # Load Branch Info cat "$PSScriptRoot\..\branchinfo.txt" | ForEach-Object { if(!$_.StartsWith("#") -and ![String]::IsNullOrWhiteSpace($_)) { diff --git a/test/Installer/testmsi.ps1 b/test/Installer/testmsi.ps1 index b25f66a48..2a11669be 100644 --- a/test/Installer/testmsi.ps1 +++ b/test/Installer/testmsi.ps1 @@ -69,10 +69,14 @@ try { Write-Host "Running installer tests in Windows Container" + # --net="none" works around a networking issue on the containers on the CI machines. + # Since our installer tests don't require the network, it is fine to shut it off. $MsiFileName = [System.IO.Path]::GetFileName($inputMsi) docker run ` + --rm ` -v "$testBin\:D:" ` -e "CLI_MSI=D:\$MsiFileName" ` + --net="none" ` windowsservercore ` D:\xunit.console.exe D:\$testName.dll | Out-Host