ci: speed up CI using multiple processes with pytest-xist (#67064)
This commit is contained in:
parent
1b2560b2f7
commit
4188859d01
|
@ -6,7 +6,7 @@ pipeline {
|
|||
stages {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
sh 'tox -rv'
|
||||
sh 'NUMPROCESSES=8 tox -rv'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
|
4
tox.ini
4
tox.ini
|
@ -5,6 +5,7 @@ envlist = py3-django22-codestyle-coverage, pylint
|
|||
[testenv]
|
||||
sitepackages = true
|
||||
setenv =
|
||||
NUMPROCESSES={env:NUMPROCESSES:1}
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
PYTHONPATH={toxinidir}{:}{env:PYTHONPATH:}
|
||||
PYTHONHASHSEED=0
|
||||
|
@ -21,6 +22,7 @@ deps =
|
|||
pytest-mock
|
||||
pytest-cov
|
||||
pytest-django
|
||||
pytest-xdist
|
||||
pytest-freezegun
|
||||
WebTest
|
||||
mechanize
|
||||
|
@ -47,7 +49,7 @@ deps =
|
|||
pyzbar
|
||||
bleach
|
||||
commands =
|
||||
py.test -v {env:COVERAGE:} --junitxml=junit-{envname}.xml {posargs:tests/}
|
||||
py.test -v {env:COVERAGE:} --numprocesses={env:NUMPROCESSES:1} --dist loadfile --junitxml=junit-{envname}.xml {posargs:tests/}
|
||||
codestyle: pre-commit run --all-files --show-diff-on-failure
|
||||
|
||||
[testenv:pylint]
|
||||
|
|
Loading…
Reference in New Issue