ci: speed up CI using multiple processes with pylint and pytest (#67080)
This commit is contained in:
parent
e0add9575c
commit
3cec274259
|
@ -9,7 +9,7 @@ pipeline {
|
|||
stages {
|
||||
stage('Unit Tests') {
|
||||
steps {
|
||||
sh 'tox -rv'
|
||||
sh 'NUMPROCESSES=6 tox -rv '
|
||||
}
|
||||
post {
|
||||
always {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#!/bin/bash
|
||||
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
|
@ -10,6 +10,7 @@ setenv =
|
|||
BRANCH_NAME={env:BRANCH_NAME:}
|
||||
WCSCTL=wcs/wcsctl.py
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
NUMPROCESSES={env:NUMPROCESSES:1}
|
||||
fast: FAST=--nomigrations
|
||||
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc -Wignore
|
||||
deps =
|
||||
|
@ -19,6 +20,7 @@ deps =
|
|||
psycopg2-binary<2.9
|
||||
pytest-cov
|
||||
pytest-django
|
||||
pytest-xdist
|
||||
pytest!=6.0.0
|
||||
WebTest
|
||||
mock<4
|
||||
|
@ -41,7 +43,7 @@ deps =
|
|||
codestyle: pre-commit
|
||||
commands =
|
||||
./get_wcs.sh
|
||||
py.test {posargs: {env:FAST:} {env:COVERAGE:} {env:JUNIT:} tests/}
|
||||
py.test {posargs: --numprocesses {env:NUMPROCESSES:1} --dist loadfile {env:FAST:} {env:COVERAGE:} {env:JUNIT:} tests/}
|
||||
codestyle: pre-commit run --all-files --show-diff-on-failure
|
||||
|
||||
[pytest]
|
||||
|
@ -60,6 +62,7 @@ setenv =
|
|||
PASSERELLE_SETTINGS_FILE=tests/settings.py
|
||||
BRANCH_NAME={env:BRANCH_NAME:}
|
||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
NUMPROCESSES={env:NUMPROCESSES:6}
|
||||
deps =
|
||||
pytest-django
|
||||
pytest!=6.0.0
|
||||
|
|
Loading…
Reference in New Issue