ci: speed up CI using multiple processes with pytest (#67088)
This commit is contained in:
parent
6e5eef1764
commit
346000f67f
|
@ -9,7 +9,7 @@ pipeline {
|
|||
stages {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
sh 'tox -rv'
|
||||
sh 'NUMPROCESSES=6 tox -rv'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
|
|
@ -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
|
5
tox.ini
5
tox.ini
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue