azure-pipelines.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. trigger:
  2. - master
  3. - features
  4. variables:
  5. PYTEST_ADDOPTS: "--junitxml=build/test-results/$(tox.env).xml -vv"
  6. python.needs_vc: False
  7. COVERAGE_FILE: "$(Build.Repository.LocalPath)/.coverage"
  8. COVERAGE_PROCESS_START: "$(Build.Repository.LocalPath)/.coveragerc"
  9. PYTEST_COVERAGE: '0'
  10. jobs:
  11. - job: 'Test'
  12. pool:
  13. vmImage: "vs2017-win2016"
  14. strategy:
  15. matrix:
  16. py27:
  17. python.version: '2.7'
  18. tox.env: 'py27'
  19. py27-nobyte-lsof-numpy:
  20. python.version: '2.7'
  21. tox.env: 'py27-lsof-nobyte-numpy'
  22. # Coverage for:
  23. # - test_supports_breakpoint_module_global
  24. # - test_terminal_reporter_writer_attr (without xdist)
  25. # - "if write" branch in _pytest.assertion.rewrite
  26. # - numpy
  27. # - pytester's LsofFdLeakChecker (being skipped)
  28. PYTEST_COVERAGE: '1'
  29. py27-twisted:
  30. python.version: '2.7'
  31. tox.env: 'py27-twisted'
  32. python.needs_vc: True
  33. py27-pluggymaster-xdist:
  34. python.version: '2.7'
  35. tox.env: 'py27-pluggymaster-xdist'
  36. # Coverage for:
  37. # - except-IOError in _attempt_to_close_capture_file for py2.
  38. # Also seen with py27-nobyte (using xdist), and py27-xdist.
  39. # But no exception with py27-pexpect,py27-twisted,py27-numpy.
  40. PYTEST_COVERAGE: '1'
  41. # -- pypy2 and pypy3 are disabled for now: #5279 --
  42. # pypy:
  43. # python.version: 'pypy2'
  44. # tox.env: 'pypy'
  45. # pypy3:
  46. # python.version: 'pypy3'
  47. # tox.env: 'pypy3'
  48. py35-xdist:
  49. python.version: '3.5'
  50. tox.env: 'py35-xdist'
  51. # Coverage for:
  52. # - test_supports_breakpoint_module_global
  53. PYTEST_COVERAGE: '1'
  54. py36-xdist:
  55. python.version: '3.6'
  56. tox.env: 'py36-xdist'
  57. py37:
  58. python.version: '3.7'
  59. tox.env: 'py37'
  60. # Coverage for:
  61. # - _py36_windowsconsoleio_workaround (with py36+)
  62. # - test_request_garbage (no xdist)
  63. PYTEST_COVERAGE: '1'
  64. py37-linting/docs/doctesting:
  65. python.version: '3.7'
  66. tox.env: 'linting,docs,doctesting'
  67. py37-twisted/numpy:
  68. python.version: '3.7'
  69. tox.env: 'py37-twisted,py37-numpy'
  70. py37-pluggymaster-xdist:
  71. python.version: '3.7'
  72. tox.env: 'py37-pluggymaster-xdist'
  73. maxParallel: 10
  74. steps:
  75. - task: UsePythonVersion@0
  76. inputs:
  77. versionSpec: '$(python.version)'
  78. architecture: 'x64'
  79. - script: choco install vcpython27
  80. condition: eq(variables['python.needs_vc'], True)
  81. displayName: 'Install VC for py27'
  82. - script: python -m pip install tox
  83. displayName: 'Install tox'
  84. - script: |
  85. call scripts/setup-coverage-vars.bat || goto :eof
  86. python -m tox -e $(tox.env)
  87. displayName: 'Run tests'
  88. - task: PublishTestResults@2
  89. inputs:
  90. testResultsFiles: 'build/test-results/$(tox.env).xml'
  91. testRunTitle: '$(tox.env)'
  92. condition: succeededOrFailed()
  93. - script: call scripts\upload-coverage.bat
  94. displayName: 'Report and upload coverage'
  95. condition: eq(variables['PYTEST_COVERAGE'], '1')
  96. env:
  97. CODECOV_TOKEN: $(CODECOV_TOKEN)
  98. PYTEST_CODECOV_NAME: $(tox.env)