2019-02-13 05:01:30 +08:00
|
|
|
trigger:
|
|
|
|
- master
|
|
|
|
- features
|
|
|
|
|
2019-02-13 06:24:32 +08:00
|
|
|
variables:
|
2019-02-28 01:31:40 +08:00
|
|
|
PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml -vv"
|
2019-02-14 04:59:36 +08:00
|
|
|
python.needs_vc: False
|
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-03-01 21:55:09 +08:00
|
|
|
py27-nobyte-lsof-numpy:
|
2019-02-14 04:59:36 +08:00
|
|
|
python.version: '2.7'
|
2019-03-01 21:55:09 +08:00
|
|
|
tox.env: 'py27-lsof-nobyte-numpy'
|
|
|
|
# Coverage for:
|
|
|
|
# - test_supports_breakpoint_module_global
|
|
|
|
# - test_terminal_reporter_writer_attr (without xdist)
|
|
|
|
# - "if write" branch in _pytest.assertion.rewrite
|
|
|
|
# - numpy
|
|
|
|
# - pytester's LsofFdLeakChecker (being skipped)
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-03-21 01:37:34 +08:00
|
|
|
py27-twisted:
|
2019-02-14 04:59:36 +08:00
|
|
|
python.version: '2.7'
|
2019-03-21 01:37:34 +08:00
|
|
|
tox.env: 'py27-twisted'
|
2019-02-14 04:59:36 +08:00
|
|
|
python.needs_vc: True
|
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-03-01 21:55:09 +08:00
|
|
|
# Coverage for:
|
|
|
|
# - except-IOError in _attempt_to_close_capture_file for py2.
|
|
|
|
# Also seen with py27-nobyte (using xdist), and py27-xdist.
|
2019-03-21 01:37:34 +08:00
|
|
|
# But no exception with py27-pexpect,py27-twisted,py27-numpy.
|
2019-03-01 21:55:09 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-05-16 23:18:30 +08:00
|
|
|
# -- pypy2 and pypy3 are disabled for now: #5279 --
|
|
|
|
# pypy:
|
|
|
|
# python.version: 'pypy2'
|
|
|
|
# tox.env: 'pypy'
|
|
|
|
# pypy3:
|
|
|
|
# python.version: 'pypy3'
|
|
|
|
# tox.env: 'pypy3'
|
2019-03-01 21:55:09 +08:00
|
|
|
py34-xdist:
|
2019-02-14 04:59:36 +08:00
|
|
|
python.version: '3.4'
|
2019-03-01 21:55:09 +08:00
|
|
|
tox.env: 'py34-xdist'
|
|
|
|
# Coverage for:
|
|
|
|
# - _pytest.compat._bytes_to_ascii
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-03-01 21:55:09 +08:00
|
|
|
py35-xdist:
|
2019-02-13 05:01:30 +08:00
|
|
|
python.version: '3.5'
|
2019-03-01 21:55:09 +08:00
|
|
|
tox.env: 'py35-xdist'
|
|
|
|
# Coverage for:
|
|
|
|
# - test_supports_breakpoint_module_global
|
2019-02-27 06:22:23 +08:00
|
|
|
PYTEST_COVERAGE: '1'
|
2019-03-01 21:55:09 +08:00
|
|
|
py36-xdist:
|
2019-02-13 05:01:30 +08:00
|
|
|
python.version: '3.6'
|
2019-03-01 21:55:09 +08:00
|
|
|
tox.env: 'py36-xdist'
|
2019-02-13 05:01:30 +08:00
|
|
|
py37:
|
|
|
|
python.version: '3.7'
|
|
|
|
tox.env: 'py37'
|
2019-03-01 21:55:09 +08:00
|
|
|
# Coverage for:
|
|
|
|
# - _py36_windowsconsoleio_workaround (with py36+)
|
|
|
|
# - test_request_garbage (no xdist)
|
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'
|
2019-03-21 01:37:34 +08:00
|
|
|
py37-twisted/numpy:
|
2019-02-14 04:59:36 +08:00
|
|
|
python.version: '3.7'
|
2019-03-21 01:37:34 +08:00
|
|
|
tox.env: 'py37-twisted,py37-numpy'
|
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
|
|
|
|
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'
|
|
|
|
|
2019-05-16 19:07:59 +08:00
|
|
|
- script: python -m pip install --upgrade pip && python -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
|
2019-05-16 19:07:59 +08:00
|
|
|
python -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
|
2019-03-05 00:51:25 +08:00
|
|
|
displayName: 'Report and 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)
|
2019-02-27 15:46:19 +08:00
|
|
|
PYTEST_CODECOV_NAME: $(tox.env)
|