jenkinsfile: use parallel for pytest/vitest/pylint (#85071)
gitea/passerelle/pipeline/head This commit looks good Details

This commit is contained in:
Thomas NOËL 2023-12-22 12:52:12 +01:00
parent d0ecf8af77
commit 43e2d9222a
2 changed files with 28 additions and 13 deletions

39
Jenkinsfile vendored
View File

@ -11,19 +11,34 @@ pipeline {
RAND_TEST = "${Math.abs(new Random().nextInt(max+1))}" RAND_TEST = "${Math.abs(new Random().nextInt(max+1))}"
} }
stages { stages {
stage('Unit Tests') { stage('Tests (in parallel)') {
steps { failFast true
sh "NUMPROCESSES=12 RAND_TEST=${env.RAND_TEST} tox -rv" parallel {
} stage('Unit Tests (pytest)') {
post { steps {
always { sh "NUMPROCESSES=12 RAND_TEST=${env.RAND_TEST} tox -rv"
script { }
utils = new Utils() post {
utils.publish_coverage('coverage.xml') always {
utils.publish_coverage_native('index.html') script {
utils.publish_pylint('pylint.out') 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()
} }
} }
} }

View File

@ -1,6 +1,6 @@
[tox] [tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:RAND_TEST:} toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:RAND_TEST:}
envlist = py3-django32-codestyle-coverage,pylint,vitest envlist = py3-django32-codestyle-coverage
[testenv] [testenv]
usedevelop = True usedevelop = True