ci: speed up CI using multiple processes with pytest-xist (#67064)

This commit is contained in:
Agate 2022-07-06 11:51:44 +02:00
parent 1b2560b2f7
commit 4188859d01
2 changed files with 4 additions and 2 deletions

2
Jenkinsfile vendored
View File

@ -6,7 +6,7 @@ pipeline {
stages {
stage('Unit Tests') {
steps {
sh 'tox -rv'
sh 'NUMPROCESSES=8 tox -rv'
}
post {
always {

View File

@ -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]