Run tests in parallel accross multiple processes

By using pytest-xdist.

We must use --dist=loadfile (i.e. one worker per file) because cubicweb.devtools.startpgcluster can't be run concurrently.

authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
changeset849d0f8ae106
branchdefault
phasedraft
hiddenno
parent revision#3c66c31ebdd2 fix: UX when migractions failed to get its connection
child revision<not specified>
files modified by this revision
requirements/dev.txt
tox.ini
# HG changeset patch
# User Philippe Pepiot <philippe.pepiot@logilab.fr>
# Date 1540801653 -3600
# Mon Oct 29 09:27:33 2018 +0100
# Node ID 849d0f8ae10648f7e4c826bd1714c21a25b38146
# Parent 3c66c31ebdd2394ea6a254563c8bb662004aaf7e
Run tests in parallel accross multiple processes

By using pytest-xdist.

We must use --dist=loadfile (i.e. one worker per file) because
cubicweb.devtools.startpgcluster can't be run concurrently.

diff --git a/requirements/dev.txt b/requirements/dev.txt
@@ -1,5 +1,6 @@
1  pytest
2  pytest-subtests
3  pytest-html
4  git+https://github.com/Psycojoker/pytest-capture-deprecatedwarnings
5  pytest-cov
6 +pytest-xdist
diff --git a/tox.ini b/tox.ini
@@ -14,13 +14,13 @@
7    misc: -r{toxinidir}/requirements/test-misc.txt
8    server: -r{toxinidir}/requirements/test-server.txt
9    web: -r{toxinidir}/requirements/test-web.txt
10  commands =
11    misc: {envpython} -m pip install --upgrade --no-deps --quiet https://github.com/logilab/yapps/tarball/master#egg=yapps
12 -  misc: {envpython} -m pytest --cov-report xml:{toxinidir}/reports/coverage-misc.xml --cov=cubicweb -rs --html=misc.html {posargs} {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test {toxinidir}/cubicweb/pyramid/test
13 -  server: {envpython} -m pytest --cov-report xml:{toxinidir}/reports/coverage-server.xml --cov=cubicweb -rs --html=server.html {posargs} {toxinidir}/cubicweb/server/test
14 -  web: {envpython} -m pytest --cov-report xml:{toxinidir}/reports/coverage-web.xml --cov=cubicweb -rs --html=web.html {posargs} {toxinidir}/cubicweb/web/test
15 +  misc: {envpython} -m pytest --cov-report xml:{toxinidir}/reports/coverage-misc.xml --cov=cubicweb -rs --html=misc.html {posargs: -n auto --dist=loadfile} {toxinidir}/cubicweb/test {toxinidir}/cubicweb/dataimport/test {toxinidir}/cubicweb/devtools/test {toxinidir}/cubicweb/entities/test {toxinidir}/cubicweb/ext/test {toxinidir}/cubicweb/hooks/test {toxinidir}/cubicweb/sobjects/test {toxinidir}/cubicweb/wsgi/test {toxinidir}/cubicweb/pyramid/test
16 +  server: {envpython} -m pytest --cov-report xml:{toxinidir}/reports/coverage-server.xml --cov=cubicweb -rs --html=server.html {posargs: -n auto --dist=loadfile} {toxinidir}/cubicweb/server/test
17 +  web: {envpython} -m pytest --cov-report xml:{toxinidir}/reports/coverage-web.xml --cov=cubicweb -rs --html=web.html {posargs: -n auto --dist=loadfile} {toxinidir}/cubicweb/web/test
18 
19  [testenv:py3-from-forge-misc]
20  basepython=python3
21  deps =
22    -r{toxinidir}/requirements/from-forge.txt