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 {
|
stages {
|
||||||
stage('Unit Tests') {
|
stage('Unit Tests') {
|
||||||
steps {
|
steps {
|
||||||
sh 'tox -rv'
|
sh 'NUMPROCESSES=6 tox -rv '
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e -x
|
set -e -x
|
||||||
env
|
env
|
||||||
|
pylint --jobs ${NUMPROCESSES:-1} -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0
|
||||||
pylint -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:}
|
BRANCH_NAME={env:BRANCH_NAME:}
|
||||||
WCSCTL=wcs/wcsctl.py
|
WCSCTL=wcs/wcsctl.py
|
||||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
|
NUMPROCESSES={env:NUMPROCESSES:1}
|
||||||
fast: FAST=--nomigrations
|
fast: FAST=--nomigrations
|
||||||
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc -Wignore
|
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc -Wignore
|
||||||
deps =
|
deps =
|
||||||
|
@ -19,6 +20,7 @@ deps =
|
||||||
psycopg2-binary<2.9
|
psycopg2-binary<2.9
|
||||||
pytest-cov
|
pytest-cov
|
||||||
pytest-django
|
pytest-django
|
||||||
|
pytest-xdist
|
||||||
pytest!=6.0.0
|
pytest!=6.0.0
|
||||||
WebTest
|
WebTest
|
||||||
mock<4
|
mock<4
|
||||||
|
@ -41,7 +43,7 @@ deps =
|
||||||
codestyle: pre-commit
|
codestyle: pre-commit
|
||||||
commands =
|
commands =
|
||||||
./get_wcs.sh
|
./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
|
codestyle: pre-commit run --all-files --show-diff-on-failure
|
||||||
|
|
||||||
[pytest]
|
[pytest]
|
||||||
|
@ -60,6 +62,7 @@ setenv =
|
||||||
PASSERELLE_SETTINGS_FILE=tests/settings.py
|
PASSERELLE_SETTINGS_FILE=tests/settings.py
|
||||||
BRANCH_NAME={env:BRANCH_NAME:}
|
BRANCH_NAME={env:BRANCH_NAME:}
|
||||||
SETUPTOOLS_USE_DISTUTILS=stdlib
|
SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||||
|
NUMPROCESSES={env:NUMPROCESSES:6}
|
||||||
deps =
|
deps =
|
||||||
pytest-django
|
pytest-django
|
||||||
pytest!=6.0.0
|
pytest!=6.0.0
|
||||||
|
|
Loading…
Reference in New Issue