PowerShell/.vsts-ci/templates/windows-test.yml
Travis Plunk a7f798575d
Parallelize the windows CI to enable us to run all tests all the time (#8868)
Split Windows CI into the following Jobs

1. Combine Build and xUnit, which published build artifact
1. Elevated CI tests
1. Unelevated CI test
1. Elevated everything else tests
1. Unelevated everything else tests
1. Package build and test
1. Verify xUnit result

## PR Context  

Before this test:

- A CI run would take ~14 minutes
- A Feature run would take ~30 minutes

After this change, it always runs all tests and takes ~20 minutes.
Job `Unelevated everything else tests` is the long poll, taking ~4 minutes longer than the next shortest job.  We should be able to get this back down to ~15 if we split that test job somehow.
2019-02-14 16:33:19 -08:00

51 lines
1.6 KiB
YAML

parameters:
pool: 'Hosted VS2017'
parentJobs: []
purpose: ''
tagSet: 'CI'
jobs:
- job: win_test_${{ parameters.purpose }}_${{ parameters.tagSet }}
dependsOn:
${{ parameters.parentJobs }}
pool:
name: ${{ parameters.pool }}
displayName: Windows Test - ${{ parameters.purpose }} - ${{ parameters.tagSet }}
steps:
- powershell: |
Get-ChildItem -Path env:
displayName: Capture environment
condition: succeededOrFailed()
- task: DownloadBuildArtifacts@0
displayName: 'Download build artifacts'
inputs:
downloadType: specific
itemPattern: |
build/**/*
downloadPath: '$(System.ArtifactsDirectory)'
- powershell: |
dir "$(System.ArtifactsDirectory)\*" -Recurse
displayName: 'Capture artifacts directory'
continueOnError: true
- powershell: |
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Import-Module .\tools\ci.psm1
Invoke-AppveyorInstall
displayName: Bootstrap
condition: succeededOrFailed()
- powershell: |
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
$options = (Get-PSOptions)
$path = split-path -path $options.Output
$rootPath = split-Path -path $path
Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force
Invoke-AppveyorTest -Purpose '${{ parameters.purpose }}' -TagSet '${{ parameters.tagSet }}'
displayName: Test
condition: succeeded()