From 43f65ae54c39744459e746a4dfc728565d0df5e0 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Thu, 9 Apr 2020 13:40:00 +0530 Subject: [PATCH] Break up AP Windows tests --- .azure-pipelines/jobs/test-windows.yml | 48 ++++++++++++++++---- .azure-pipelines/steps/run-tests-windows.yml | 31 ++++++++++--- 2 files changed, 62 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines/jobs/test-windows.yml b/.azure-pipelines/jobs/test-windows.yml index 80bbcfa117d..a78e6da6f4a 100644 --- a/.azure-pipelines/jobs/test-windows.yml +++ b/.azure-pipelines/jobs/test-windows.yml @@ -9,30 +9,59 @@ jobs: vmImage: ${{ parameters.vmImage }} strategy: matrix: - "2.7-x86": + "2.7-x86 (1)": python.version: '2.7' python.architecture: x86 - "2.7": + testGroup: 1 + "2.7-x86 (2)": python.version: '2.7' + python.architecture: x86 + testGroup: 2 + "2.7 (1)": + python.version: '2.7' + python.architecture: x64 + testGroup: 1 + "2.7 (2)": + python.version: '2.7' + python.architecture: x64 + testGroup: 2 + "3.5 (1)": + python.version: '3.5' python.architecture: x64 - "3.5": + testGroup: 1 + "3.5 (2)": python.version: '3.5' python.architecture: x64 - "3.6": + testGroup: 2 + "3.6 (1)": python.version: '3.6' python.architecture: x64 - "3.7": + testGroup: 1 + "3.6 (2)": + python.version: '3.6' + python.architecture: x64 + testGroup: 2 + "3.7 (1)": + python.version: '3.7' + python.architecture: x64 + testGroup: 1 + "3.7 (2)": python.version: '3.7' python.architecture: x64 - "3.8": + testGroup: 2 + "3.8 (1)": + python.version: '3.8' + python.architecture: x64 + testGroup: 1 + "3.8 (2)": python.version: '3.8' python.architecture: x64 - maxParallel: 6 + testGroup: 2 steps: - template: ../steps/run-tests-windows.yml parameters: - runIntegrationTests: true + testGroup: $(testGroup) - job: Test_Secondary displayName: Tests / Windows / @@ -56,9 +85,8 @@ jobs: 3.8-x86: python.version: '3.8' python.architecture: x86 - maxParallel: 6 steps: - template: ../steps/run-tests-windows.yml parameters: - runIntegrationTests: false + testGroup: null diff --git a/.azure-pipelines/steps/run-tests-windows.yml b/.azure-pipelines/steps/run-tests-windows.yml index 5793a791f9c..047f1ff3617 100644 --- a/.azure-pipelines/steps/run-tests-windows.yml +++ b/.azure-pipelines/steps/run-tests-windows.yml @@ -1,5 +1,5 @@ parameters: - runIntegrationTests: + testGroup: steps: - displayName: Use Python $(python.version) @@ -27,12 +27,14 @@ steps: - displayName: Install Tox bash: pip install --upgrade 'virtualenv<20' setuptools tox -- displayName: Run unit tests - script: tox -e py -- -m unit -n auto --junit-xml=junit/unit-test.xml - env: - TEMP: "R:\\Temp" +# Lots of fun logic, for... running the correct tests. +- ${{ if in(parameters.testGroup, null, 1) }}: + - displayName: Run unit tests + script: tox -e py -- -m unit -n auto --junit-xml=junit/unit-test.xml + env: + TEMP: "R:\\Temp" -- ${{ if eq(parameters.runIntegrationTests, 'true') }}: +- ${{ if eq(parameters.testGroup, 1) }}: - displayName: Run integration tests powershell: | # Fix Git SSL errors @@ -45,7 +47,22 @@ steps: $env:TEMP = "R:\Temp" pip install tox - tox -e py -- -m integration -n auto --duration=5 --junit-xml=junit/integration-test.xml + tox -e py -- -k "not test_install" -m integration -n auto --duration=5 --junit-xml=junit/integration-test.xml + +- ${{ if eq(parameters.testGroup, 2) }}: + - displayName: Run integration tests + powershell: | + # Fix Git SSL errors + pip install certifi + python -m certifi > cacert.txt + $env:GIT_SSL_CAINFO = $(Get-Content cacert.txt) + + # Shorten paths to get under MAX_PATH or else integration tests will fail + # https://bugs.python.org/issue18199 + $env:TEMP = "R:\Temp" + + pip install tox + tox -e py -- -k "not test_install" -m integration -n auto --duration=5 --junit-xml=junit/integration-test.xml - displayName: Publish Test Results task: PublishTestResults@2