ci: speed up CI using multiple processes with pytest (#67088)

This commit is contained in:
Agate 2022-07-06 17:02:23 +02:00
parent 6e5eef1764
commit 346000f67f
3 changed files with 6 additions and 3 deletions

2
Jenkinsfile vendored
View File

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

View File

@ -2,4 +2,4 @@
set -e -x
env
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0
pylint --jobs ${NUMPROCESSES:-1} -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0

View File

@ -9,6 +9,7 @@ setenv =
COMBO_SETTINGS_FILE=tests/settings.py
TOX_WORK_DIR={toxworkdir}
SETUPTOOLS_USE_DISTUTILS=stdlib
NUMPROCESSES={env:NUMPROCESSES:1}
coverage: COVERAGE=--cov-report xml --cov-report html --cov=combo/ --cov-config .coveragerc -v
DB_ENGINE=django.db.backends.postgresql_psycopg2
passenv =
@ -19,6 +20,7 @@ deps =
pytest-cov
pytest-django
pytest-freezegun
pytest-xdist
pytest!=5.3.3
WebTest
mock<4
@ -38,7 +40,7 @@ deps =
commands =
./getlasso3.sh
python manage.py compilemessages
py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/}
py.test {env:COVERAGE:} {posargs: --numprocesses {env:NUMPROCESSES:1} --junitxml=junit-{envname}.xml tests/}
codestyle: pre-commit run --all-files --show-diff-on-failure
[testenv:pylint]
@ -48,6 +50,7 @@ setenv =
TOX_WORK_DIR={toxworkdir}
SETUPTOOLS_USE_DISTUTILS=stdlib
DB_ENGINE=django.db.backends.postgresql_psycopg2
NUMPROCESSES={env:NUMPROCESSES:1}
deps =
pytest-django
pytest-freezegun