Run functional tests for install in separate jobs (#5436)

Speeds up the end-to-end running time for Travis tests.

* Adds a new jobs to test_install* separately (using -k "[not] test_install")
* More generic cache ignore
* Move slower Python 3.5 tests before 3.4
* Factor tox envs
This commit is contained in:
Hugo 2018-05-26 14:16:12 +03:00 committed by Pradyun Gedam
parent 8619e3edea
commit 61b011293b
4 changed files with 34 additions and 16 deletions

2
.gitignore vendored
View File

@ -22,7 +22,7 @@ docs/build/
htmlcov/ htmlcov/
.coverage .coverage
.coverage.* .coverage.*
.cache .*cache
nosetests.xml nosetests.xml
coverage.xml coverage.xml
*.cover *.cover

View File

@ -12,22 +12,36 @@ matrix:
- env: TOXENV=mypy - env: TOXENV=mypy
- env: TOXENV=packaging - env: TOXENV=packaging
# PyPy jobs start first -- they are the slowest # PyPy jobs start first -- they are the slowest
- env: TOXENV=pypy - env: TOXENV=pypy3-functional-install
python: pypy
- env: TOXENV=pypy3
python: pypy3 python: pypy3
- env: TOXENV=pypy3-others
python: pypy3
- env: TOXENV=pypy-functional-install
python: pypy
- env: TOXENV=pypy-others
python: pypy
# Latest Stable CPython jobs # Latest Stable CPython jobs
- env: TOXENV=py27 - env: TOXENV=py27-functional-install
python: 2.7 python: 2.7
- env: TOXENV=py36 - env: TOXENV=py27-others
python: 2.7
- env: TOXENV=py36-functional-install
python: 3.6
- env: TOXENV=py36-others
python: 3.6 python: 3.6
# All the other Py3 versions # All the other Py3 versions
- env: TOXENV=py34 - env: TOXENV=py35-functional-install
python: 3.4
- env: TOXENV=py35
python: 3.5 python: 3.5
- env: TOXENV=py35-others
python: 3.5
- env: TOXENV=py34-functional-install
python: 3.4
- env: TOXENV=py34-others
python: 3.4
# Nightly Python goes last # Nightly Python goes last
- env: TOXENV=py37 - env: TOXENV=py37-functional-install
python: nightly
- env: TOXENV=py37-others
python: nightly python: nightly
allow_failures: allow_failures:
- python: nightly - python: nightly

View File

@ -24,11 +24,15 @@ if [[ $TOXENV != docs ]]; then
fi fi
fi fi
if [[ $TOXENV == py* ]]; then if [[ $TOXENV == py*-functional-install ]]; then
# Only run test_install*.py integration tests
tox -- -m integration -n 4 --duration=5 -k test_install
elif [[ $TOXENV == py* ]]; then
# Run unit tests # Run unit tests
tox -- -m unit tox -- -m unit
# Run integration tests
tox -- -m integration -n 4 --duration=5 # Run other integration tests
tox -- -m integration -n 4 --duration=5 -k "not test_install"
else else
# Run once # Run once
tox tox

View File

@ -1,7 +1,7 @@
[tox] [tox]
envlist = envlist =
docs, packaging, lint-py2, lint-py3, mypy, docs, packaging, lint-py2, lint-py3, mypy,
py27, py34, py35, py36, py37, pypy py{27,34,35,36,37,py,py3}-{functional-install,others}
[testenv] [testenv]
passenv = CI GIT_SSL_CAINFO passenv = CI GIT_SSL_CAINFO
@ -10,13 +10,13 @@ setenv =
# that our tests use. # that our tests use.
LC_CTYPE = en_US.UTF-8 LC_CTYPE = en_US.UTF-8
deps = -r{toxinidir}/dev-requirements.txt deps = -r{toxinidir}/dev-requirements.txt
commands = py.test --timeout 300 [] commands = pytest --timeout 300 []
install_command = python -m pip install {opts} {packages} install_command = python -m pip install {opts} {packages}
usedevelop = True usedevelop = True
[testenv:coverage-py3] [testenv:coverage-py3]
basepython = python3 basepython = python3
commands = py.test --timeout 300 --cov=pip --cov-report=term-missing --cov-report=xml --cov-report=html tests/unit {posargs} commands = pytest --timeout 300 --cov=pip --cov-report=term-missing --cov-report=xml --cov-report=html tests/unit {posargs}
[testenv:docs] [testenv:docs]
deps = -r{toxinidir}/docs-requirements.txt deps = -r{toxinidir}/docs-requirements.txt