2019-02-13 05:01:30 +08:00
|
|
|
trigger:
|
|
|
|
- master
|
|
|
|
- features
|
|
|
|
|
2019-02-13 06:24:32 +08:00
|
|
|
variables:
|
2019-02-13 06:34:51 +08:00
|
|
|
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml"
|
2019-02-14 04:59:36 +08:00
|
|
|
python.needs_vc: False
|
|
|
|
python.exe: "python"
|
2019-02-26 07:27:45 +08:00
|
|
|
COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
|
|
|
|
COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '0'
|
2019-02-13 06:24:32 +08:00
|
|
|
|
2019-02-13 05:01:30 +08:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
- job: 'Test'
|
|
|
|
pool:
|
|
|
|
vmImage: "vs2017-win2016"
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
py27:
|
|
|
|
python.version: '2.7'
|
|
|
|
tox.env: 'py27'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-14 04:59:36 +08:00
|
|
|
py27-xdist:
|
|
|
|
python.version: '2.7'
|
|
|
|
tox.env: 'py27-xdist'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-14 04:59:36 +08:00
|
|
|
py27-numpy/nobyte:
|
|
|
|
python.version: '2.7'
|
|
|
|
tox.env: 'py27-numpy,py27-nobyte'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-14 04:59:36 +08:00
|
|
|
py27-trial:
|
|
|
|
python.version: '2.7'
|
|
|
|
tox.env: 'py27-trial'
|
|
|
|
python.needs_vc: True
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-26 21:03:15 +08:00
|
|
|
py27-pluggymaster-xdist:
|
2019-02-14 04:59:36 +08:00
|
|
|
python.version: '2.7'
|
2019-02-26 21:03:15 +08:00
|
|
|
tox.env: 'py27-pluggymaster-xdist'
|
2019-02-14 04:59:36 +08:00
|
|
|
pypy:
|
|
|
|
python.version: 'pypy'
|
|
|
|
tox.env: 'pypy'
|
|
|
|
python.exe: 'pypy'
|
|
|
|
py34:
|
|
|
|
python.version: '3.4'
|
|
|
|
tox.env: 'py34'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-13 05:01:30 +08:00
|
|
|
py35:
|
|
|
|
python.version: '3.5'
|
|
|
|
tox.env: 'py35'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-13 05:01:30 +08:00
|
|
|
py36:
|
|
|
|
python.version: '3.6'
|
|
|
|
tox.env: 'py36'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-13 05:01:30 +08:00
|
|
|
py37:
|
|
|
|
python.version: '3.7'
|
|
|
|
tox.env: 'py37'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-14 04:59:36 +08:00
|
|
|
py37-linting/docs/doctesting:
|
|
|
|
python.version: '3.7'
|
|
|
|
tox.env: 'linting,docs,doctesting'
|
|
|
|
py37-xdist:
|
|
|
|
python.version: '3.7'
|
|
|
|
tox.env: 'py37-xdist'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-14 04:59:36 +08:00
|
|
|
py37-trial/numpy:
|
|
|
|
python.version: '3.7'
|
|
|
|
tox.env: 'py37-trial,py37-numpy'
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-02-26 21:03:15 +08:00
|
|
|
py37-pluggymaster-xdist:
|
2019-02-14 04:59:36 +08:00
|
|
|
python.version: '3.7'
|
2019-02-26 21:03:15 +08:00
|
|
|
tox.env: 'py37-pluggymaster-xdist'
|
2019-02-14 04:59:36 +08:00
|
|
|
maxParallel: 10
|
2019-02-13 05:01:30 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
2019-02-14 04:59:36 +08:00
|
|
|
condition: not(startsWith(variables['python.exe'], 'pypy'))
|
2019-02-13 05:01:30 +08:00
|
|
|
inputs:
|
|
|
|
versionSpec: '$(python.version)'
|
|
|
|
architecture: 'x64'
|
|
|
|
|
2019-02-14 04:59:36 +08:00
|
|
|
- script: choco install vcpython27
|
|
|
|
condition: eq(variables['python.needs_vc'], True)
|
|
|
|
displayName: 'Install VC for py27'
|
|
|
|
|
|
|
|
- script: choco install python.pypy
|
|
|
|
condition: eq(variables['python.exe'], 'pypy')
|
|
|
|
displayName: 'Install pypy'
|
|
|
|
|
|
|
|
- script: choco install pypy3
|
|
|
|
condition: eq(variables['python.exe'], 'pypy3')
|
|
|
|
displayName: 'Install pypy3'
|
|
|
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
inputs:
|
|
|
|
targetType: 'inline'
|
|
|
|
script: |
|
|
|
|
Invoke-WebRequest -Uri "https://bootstrap.pypa.io/get-pip.py" -OutFile "get-pip.py"
|
|
|
|
$(python.exe) get-pip.py
|
|
|
|
condition: startsWith(variables['python.exe'], 'pypy')
|
|
|
|
displayName: 'Install pip'
|
|
|
|
|
|
|
|
- script: $(python.exe) -m pip install --upgrade pip && $(python.exe) -m pip install tox
|
2019-02-13 05:01:30 +08:00
|
|
|
displayName: 'Install tox'
|
|
|
|
|
2019-02-27 06:22:23 +08:00
|
|
|
- script: |
|
|
|
|
call scripts/setup-coverage-vars.bat || goto :eof
|
|
|
|
$(python.exe) -m tox -e $(tox.env)
|
2019-02-13 05:01:30 +08:00
|
|
|
displayName: 'Run tests'
|
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: 'build/test-results/$(tox.env).xml'
|
|
|
|
testRunTitle: '$(tox.env)'
|
|
|
|
condition: succeededOrFailed()
|
2019-02-26 07:27:45 +08:00
|
|
|
|
|
|
|
- script: call scripts\upload-coverage.bat
|
|
|
|
displayName: 'Upload coverage'
|
2019-02-27 06:22:23 +08:00
|
|
|
condition: eq(variables['PYTEST_COVERAGE'], '1')
|
2019-02-26 07:27:45 +08:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: $(CODECOV_TOKEN)
|