From 43e2d9222a84e879b95e14d22b65b9a7d3af955a Mon Sep 17 00:00:00 2001 From: Thomas NOEL Date: Fri, 22 Dec 2023 12:52:12 +0100 Subject: [PATCH] jenkinsfile: use parallel for pytest/vitest/pylint (#85071) --- Jenkinsfile | 39 +++++++++++++++++++++++++++------------ tox.ini | 2 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2fb2d5e5..016187ce 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,19 +11,34 @@ pipeline { RAND_TEST = "${Math.abs(new Random().nextInt(max+1))}" } stages { - stage('Unit Tests') { - steps { - sh "NUMPROCESSES=12 RAND_TEST=${env.RAND_TEST} tox -rv" - } - post { - always { - script { - utils = new Utils() - utils.publish_coverage('coverage.xml') - utils.publish_coverage_native('index.html') - utils.publish_pylint('pylint.out') + stage('Tests (in parallel)') { + failFast true + parallel { + stage('Unit Tests (pytest)') { + steps { + sh "NUMPROCESSES=12 RAND_TEST=${env.RAND_TEST} tox -rv" + } + post { + always { + script { + utils = new Utils() + utils.publish_coverage('coverage.xml') + utils.publish_coverage_native('index.html') + utils.publish_pylint('pylint.out') + } + mergeJunitResults() + } + } + } + stage('Unit Tests (vitest)') { + steps { + sh "NUMPROCESSES=12 RAND_TEST=${env.RAND_TEST} tox -rv -e vitest" + } + } + stage('Linter (pylint)') { + steps { + sh "NUMPROCESSES=12 RAND_TEST=${env.RAND_TEST} tox -rv -e pylint" } - mergeJunitResults() } } } diff --git a/tox.ini b/tox.ini index e8668392..72d6ef6c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:RAND_TEST:} -envlist = py3-django32-codestyle-coverage,pylint,vitest +envlist = py3-django32-codestyle-coverage [testenv] usedevelop = True