Projet

Général

Profil

0001-ci-speed-up-CI-using-multiple-processes-with-pytest-.patch

A. Berriot, 06 juillet 2022 17:06

Télécharger (2,14 ko)

Voir les différences:

Subject: [PATCH] ci: speed up CI using multiple processes with pytest (#67088)

 Jenkinsfile | 2 +-
 pylint.sh   | 2 +-
 tox.ini     | 5 ++++-
 3 files changed, 6 insertions(+), 3 deletions(-)
Jenkinsfile
9 9
    stages {
10 10
        stage('Unit Tests') {
11 11
            steps {
12
                sh 'tox -rv'
12
                sh 'NUMPROCESSES=6 tox -rv'
13 13
            }
14 14
            post {
15 15
                always {
pylint.sh
2 2
set -e -x
3 3
env
4 4

  
5
pylint -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0
5
pylint --jobs ${NUMPROCESSES:-1} -f parseable --rcfile pylint.rc "$@" | tee pylint.out; test $PIPESTATUS -eq 0
tox.ini
9 9
  COMBO_SETTINGS_FILE=tests/settings.py
10 10
  TOX_WORK_DIR={toxworkdir}
11 11
  SETUPTOOLS_USE_DISTUTILS=stdlib
12
  NUMPROCESSES={env:NUMPROCESSES:1}
12 13
  coverage: COVERAGE=--cov-report xml --cov-report html --cov=combo/ --cov-config .coveragerc -v
13 14
  DB_ENGINE=django.db.backends.postgresql_psycopg2
14 15
passenv =
......
19 20
  pytest-cov
20 21
  pytest-django
21 22
  pytest-freezegun
23
  pytest-xdist
22 24
  pytest!=5.3.3
23 25
  WebTest
24 26
  mock<4
......
38 40
commands =
39 41
  ./getlasso3.sh
40 42
  python manage.py compilemessages
41
  py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/}
43
  py.test {env:COVERAGE:} {posargs: --numprocesses {env:NUMPROCESSES:1} --junitxml=junit-{envname}.xml tests/}
42 44
  codestyle: pre-commit run --all-files --show-diff-on-failure
43 45

  
44 46
[testenv:pylint]
......
48 50
  TOX_WORK_DIR={toxworkdir}
49 51
  SETUPTOOLS_USE_DISTUTILS=stdlib
50 52
  DB_ENGINE=django.db.backends.postgresql_psycopg2
53
  NUMPROCESSES={env:NUMPROCESSES:1}
51 54
deps =
52 55
  pytest-django
53 56
  pytest-freezegun
54
-