Skip to content

CI: Split PyPy tests to speed up end-to-end running time #5436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 26, 2018
Merged
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ docs/build/
htmlcov/
.coverage
.coverage.*
.cache
.*cache
nosetests.xml
coverage.xml
*.cover
Expand Down
32 changes: 23 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,36 @@ matrix:
- env: TOXENV=mypy
- env: TOXENV=packaging
# PyPy jobs start first -- they are the slowest
- env: TOXENV=pypy
python: pypy
- env: TOXENV=pypy3
- env: TOXENV=pypy3-functional-install
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
- env: TOXENV=py27
- env: TOXENV=py27-functional-install
python: 2.7
- env: TOXENV=py27-others
python: 2.7
- env: TOXENV=py36
- env: TOXENV=py36-functional-install
python: 3.6
- env: TOXENV=py36-others
python: 3.6
# All the other Py3 versions
- env: TOXENV=py34
python: 3.4
- env: TOXENV=py35
- env: TOXENV=py35-functional-install
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
- env: TOXENV=py37
- env: TOXENV=py37-functional-install
python: nightly
- env: TOXENV=py37-others
python: nightly
allow_failures:
- python: nightly
Expand Down
10 changes: 7 additions & 3 deletions .travis/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ if [[ $TOXENV != docs ]]; then
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
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
# Run once
tox
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
docs, packaging, lint-py2, lint-py3, mypy,
py27, py34, py35, py36, py37, pypy
py{27,34,35,36,37,py,py3}-{functional-install,others}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we still do tox -e py27 and tox -e py36?

If not, that'll be needed IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, that needs updating. Do you know how to do that with tox?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just add py{27,34,35,36,py,py3} right above it.

It's a duplication I won't worry about since they're basically one under the other and a mismatch would be visible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't use tox much locally, but I think the commands you gave already work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. :)


[testenv]
passenv = CI GIT_SSL_CAINFO
Expand All @@ -10,13 +10,13 @@ setenv =
# that our tests use.
LC_CTYPE = en_US.UTF-8
deps = -r{toxinidir}/dev-requirements.txt
commands = py.test --timeout 300 []
commands = pytest --timeout 300 []
install_command = python -m pip install {opts} {packages}
usedevelop = True

[testenv:coverage-py3]
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]
deps = -r{toxinidir}/docs-requirements.txt
Expand Down