2018-08-24 22:09:32 +02:00
|
|
|
parameters:
|
|
|
|
runIntegrationTests:
|
2020-01-07 01:10:00 +01:00
|
|
|
useVenv: false
|
2018-08-24 22:09:32 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
displayName: Use Python $(python.version)
|
|
|
|
inputs:
|
|
|
|
versionSpec: '$(python.version)'
|
|
|
|
architecture: '$(python.architecture)'
|
|
|
|
|
2019-10-28 05:16:42 +01:00
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
filePath: .azure-pipelines/scripts/New-RAMDisk.ps1
|
|
|
|
arguments: "-Drive R -Size 1GB"
|
|
|
|
displayName: Setup RAMDisk
|
|
|
|
|
|
|
|
- powershell: |
|
|
|
|
mkdir R:\Temp
|
|
|
|
$acl = Get-Acl "R:\Temp"
|
|
|
|
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
|
|
|
"Everyone", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
|
|
|
|
)
|
|
|
|
$acl.AddAccessRule($rule)
|
|
|
|
Set-Acl "R:\Temp" $acl
|
|
|
|
displayName: Set RAMDisk Permissions
|
|
|
|
|
2019-11-10 11:49:33 +01:00
|
|
|
- bash: pip install --upgrade setuptools tox virtualenv
|
2018-10-01 14:29:19 +02:00
|
|
|
displayName: Install Tox
|
2018-08-24 22:09:32 +02:00
|
|
|
|
2019-10-29 07:04:55 +01:00
|
|
|
- script: tox -e py -- -m unit -n auto --junit-xml=junit/unit-test.xml
|
2019-10-28 05:16:42 +01:00
|
|
|
env:
|
|
|
|
TEMP: "R:\\Temp"
|
2018-08-24 22:09:32 +02:00
|
|
|
displayName: Tox run unit tests
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.runIntegrationTests, 'true') }}:
|
|
|
|
- powershell: |
|
|
|
|
# Fix Git SSL errors
|
|
|
|
pip install certifi tox
|
|
|
|
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
|
2019-10-28 05:16:42 +01:00
|
|
|
$env:TEMP = "R:\Temp"
|
2018-08-24 22:09:32 +02:00
|
|
|
|
2020-01-07 01:10:00 +01:00
|
|
|
tox -e py -- $env:USE_VENV_ARG -m integration -n auto --duration=5 --junit-xml=junit/integration-test.xml
|
2018-08-24 22:09:32 +02:00
|
|
|
displayName: Tox run integration tests
|
2020-01-07 01:10:00 +01:00
|
|
|
env:
|
|
|
|
${{ if eq(parameters.useVenv, 'true') }}:
|
|
|
|
USE_VENV_ARG: "--use-venv"
|
2018-08-24 22:09:32 +02:00
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: junit/*.xml
|
|
|
|
testRunTitle: 'Python $(python.version)'
|
|
|
|
condition: succeededOrFailed()
|