@@ -9,69 +9,86 @@ stages:
99python :
1010 - ' 3.7'
1111install :
12- - pip install --upgrade --pre tox
13- env :
14- matrix :
15- - TOXENV=py27
16- # Specialized factors for py27.
17- - TOXENV=py27-nobyte
18- - TOXENV=py27-xdist
19- - TOXENV=py27-pluggymaster
20- # Specialized factors for py37.
21- - TOXENV=py37-pexpect,py37-trial,py37-numpy
22- - TOXENV=py37-pluggymaster
23- - TOXENV=py37-freeze PYTEST_NO_COVERAGE=1
24-
25- matrix :
26- allow_failures :
27- - python : ' 3.8-dev'
28- env : TOXENV=py38-xdist
12+ - python -m pip install --upgrade --pre tox
2913
3014jobs :
3115 include :
16+ # OSX tests - first (in test stage), since they are the slower ones.
17+ - &test-macos
18+ # NOTE: (tests with) pexpect appear to be buggy on Travis,
19+ # at least with coverage.
20+ # Log: https://travis-ci.org/pytest-dev/pytest/jobs/500358864
21+ os : osx
22+ osx_image : xcode10.1
23+ language : generic
24+ # Coverage for:
25+ # - py2 with symlink in test_cmdline_python_package_symlink.
26+ env : TOXENV=py27-xdist PYTEST_COVERAGE=1
27+ before_install :
28+ - python -V
29+ - test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
30+ - << : *test-macos
31+ env : TOXENV=py37-xdist
32+ before_install :
33+ - which python3
34+ - python3 -V
35+ - ln -sfn "$(which python3)" /usr/local/bin/python
36+ - python -V
37+ - test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37
38+
39+ # Full run of latest (major) supported versions, without xdist.
40+ - env : TOXENV=py27
41+ python : ' 2.7'
42+ - env : TOXENV=py37
43+ python : ' 3.7'
44+
3245 # Coverage tracking is slow with pypy, skip it.
33- - env : TOXENV=pypy-xdist PYTEST_NO_COVERAGE=1
46+ - env : TOXENV=pypy-xdist
3447 python : ' pypy2.7-6.0'
35- - env : TOXENV=pypy3-xdist PYTEST_NO_COVERAGE=1
48+ - env : TOXENV=pypy3-xdist
3649 python : ' pypy3.5-6.0'
3750
3851 - env : TOXENV=py34-xdist
3952 python : ' 3.4'
4053 - env : TOXENV=py35-xdist
4154 python : ' 3.5'
42- - env : TOXENV=py36-xdist
43- python : ' 3.6'
44- - env : TOXENV=py37
45- - &test-macos
46- language : generic
47- os : osx
48- osx_image : xcode9.4
49- sudo : required
50- install :
51- - python -m pip install --pre tox
52- env : TOXENV=py27-xdist
53- - << : *test-macos
54- env : TOXENV=py37-xdist
55- before_install :
56- - brew update
57- - brew upgrade python
58- - brew unlink python
59- - brew link python
55+
56+ # Coverage for:
57+ # - pytester's LsofFdLeakChecker
58+ # - TestArgComplete (linux only)
59+ # - numpy
60+ - env : TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1
61+
62+ # Specialized factors for py27.
63+ - env : TOXENV=py27-nobyte-numpy-xdist
64+ python : ' 2.7'
65+ - env : TOXENV=py27-pluggymaster-xdist
66+ python : ' 2.7'
67+
68+ # Specialized factors for py37.
69+ # Coverage for:
70+ # - test_sys_breakpoint_interception (via pexpect).
71+ - env : TOXENV=py37-pexpect,py37-trial PYTEST_COVERAGE=1
72+ - env : TOXENV=py37-pluggymaster-xdist
73+ - env : TOXENV=py37-freeze
6074
6175 # Jobs only run via Travis cron jobs (currently daily).
6276 - env : TOXENV=py38-xdist
6377 python : ' 3.8-dev'
6478 if : type = cron
6579
6680 - stage : baseline
67- env : TOXENV=py27-pexpect,py27-trial,py27-numpy
68- - env : TOXENV=py37-xdist
69- - env : TOXENV=linting,docs,doctesting
70- python : ' 3.7'
81+ # Coverage for:
82+ # - _pytest.unittest._handle_skip (via pexpect).
83+ env : TOXENV=py27-pexpect,py27-trial PYTEST_COVERAGE=1
84+ python : ' 2.7'
85+ # Use py36 here for faster baseline.
86+ - env : TOXENV=py36-xdist
87+ python : ' 3.6'
88+ - env : TOXENV=linting,docs,doctesting PYTEST_COVERAGE=1
7189
7290 - stage : deploy
7391 python : ' 3.6'
74- env : PYTEST_NO_COVERAGE=1
7592 install : pip install -U setuptools setuptools_scm
7693 script : skip
7794 deploy :
@@ -85,9 +102,19 @@ jobs:
85102 tags : true
86103 repo : pytest-dev/pytest
87104
105+ matrix :
106+ allow_failures :
107+ - python : ' 3.8-dev'
108+ env : TOXENV=py38-xdist
109+
88110before_script :
89111 - |
90- if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
112+ # Do not (re-)upload coverage with cron runs.
113+ if [[ "$TRAVIS_EVENT_TYPE" = cron ]]; then
114+ PYTEST_COVERAGE=0
115+ fi
116+ - |
117+ if [[ "$PYTEST_COVERAGE" = 1 ]]; then
91118 export COVERAGE_FILE="$PWD/.coverage"
92119 export COVERAGE_PROCESS_START="$PWD/.coveragerc"
93120 export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
@@ -98,14 +125,14 @@ script: tox --recreate
98125
99126after_success :
100127 - |
101- if [[ "$PYTEST_NO_COVERAGE" ! = 1 ]]; then
128+ if [[ "$PYTEST_COVERAGE" = 1 ]]; then
102129 set -e
103130 # Add last TOXENV to $PATH.
104131 PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH"
105132 coverage combine
106- coverage xml --ignore-errors
107- coverage report -m --ignore-errors
108- bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F $TRAVIS_OS_NAME
133+ coverage xml
134+ coverage report -m
135+ bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV- $TRAVIS_OS_NAME
109136 fi
110137
111138notifications :
0 commit comments