From 245d5c9d9ef0329b715c299a432ae9376afbc4af Mon Sep 17 00:00:00 2001 From: Agate Date: Wed, 6 Jul 2022 15:59:51 +0200 Subject: [PATCH] ci: speed up CI using multiple processes with pytest (#67083) --- Jenkinsfile | 2 +- tox.ini | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b24cfb3..7b849af 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { stages { stage('Unit Tests') { steps { - sh 'tox -rv' + sh 'NUMPROCESSES=6 tox -rv ' } post { always { diff --git a/tox.ini b/tox.ini index 2aa7b2b..2d6b802 100644 --- a/tox.ini +++ b/tox.ini @@ -19,6 +19,7 @@ commands = [testenv] usedevelop = true setenv = + NUMPROCESSES={env:NUMPROCESSES:1} DJANGO_SETTINGS_MODULE=bijoe.settings BIJOE_SETTINGS_FILE=tests/settings.py SETUPTOOLS_USE_DISTUTILS=stdlib @@ -30,6 +31,7 @@ deps = pytest-cov pytest-django pytest-freezegun + pytest-xdist WebTest django-webtest<1.9.3 mock @@ -41,7 +43,7 @@ deps = dj22: djangorestframework>=3.7 dj22: https://git.entrouvert.org/hobo.git/snapshot/hobo-main.tar.gz commands = - py3-dj22: py.test {posargs: --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=bijoe tests/} + py3-dj22: py.test {posargs: --numprocesses {env:NUMPROCESSES:1} --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=bijoe tests/} [pytest] filterwarnings = -- 2.36.1