Speed up test suite via distributed testing (#2196)

* Speed up test suite via distributed testing

Since we now run the test suite twice, one with Python 2 and another
without, full test runs are getting pretty slow. Let's try to
fix that with parallization.

Also use verbose mode on CI since more logs is usually better since
getting more is quite literally impossible.

The main issue we'll face with this is we'll hit
https://github.com/pytest-dev/pytest-xdist/issues/620 sometimes
(although pretty rarely). I suppose we can test this and see if how bad
this bug is for us, and revert if necessary down the line.

Also let's have some colours 🎉
This commit is contained in:
Richard Si 2021-05-07 10:41:55 -04:00 committed by GitHub
parent d0e06b53b0
commit 4fc1354aeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,7 @@ omit =
src/blib2to3/* src/blib2to3/*
tests/data/* tests/data/*
*/site-packages/* */site-packages/*
.tox/*
[run] [run]
relative_files = True relative_files = True

View File

@ -33,7 +33,7 @@ jobs:
- name: Unit tests - name: Unit tests
run: | run: |
tox -e py tox -e py -- -v --color=yes
- name: Publish coverage to Coveralls - name: Publish coverage to Coveralls
# If pushed / is a pull request against main repo AND # If pushed / is a pull request against main repo AND

View File

@ -3,5 +3,7 @@ pre-commit
pytest >= 6.1.1 pytest >= 6.1.1
pytest-mock >= 3.3.1 pytest-mock >= 3.3.1
pytest-cases >= 2.3.0 pytest-cases >= 2.3.0
pytest-xdist >= 2.2.1
pytest-cov >= 2.11.1
parameterized >= 0.7.4 parameterized >= 0.7.4
tox tox

View File

@ -9,9 +9,9 @@ deps =
commands = commands =
pip install -e .[d] pip install -e .[d]
coverage erase coverage erase
coverage run -m pytest tests --run-optional=no_python2 {posargs} pytest tests --run-optional no_python2 --numprocesses auto --cov {posargs}
pip install -e .[d,python2] pip install -e .[d,python2]
coverage run -m pytest tests --run-optional=python2 {posargs} pytest tests --run-optional python2 --numprocesses auto --cov --cov-append {posargs}
coverage report coverage report
[testenv:fuzz] [testenv:fuzz]