# HG changeset patch # User domruf # Date 2017-04-08 22:13:17 # Node ID 8a60eb2b7603c371c4bd8a99a603d8dbc83a99a5 # Parent 1ae319cb41b1b69ba5c3c1f9d782876b2e367922 Jenkinsfile: run each py.test on a separate executor Running all py.test processes in parallel on the same executor is not a good idea. If a node has not much RAM, it could run out of memory when all py.test processes run at the same time. And If there are only 2 CPU cores, it doesn't make sense to run more then 2 processes either. Therefore use a separate executor for each one. The py.test processes will thus only run in parallel if there are multiple Jenkins executors available. diff --git a/Jenkinsfile b/Jenkinsfile --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,7 @@ +def createvirtualenv = '' +def activatevirtualenv = '' + node { - def createvirtualenv = '' - def activatevirtualenv = '' if (isUnix()) { createvirtualenv = 'rm -r $JENKINS_HOME/venv/$JOB_NAME || true && virtualenv $JENKINS_HOME/venv/$JOB_NAME' activatevirtualenv = '. $JENKINS_HOME/venv/$JOB_NAME/bin/activate' @@ -61,8 +62,11 @@ node { echo "Caught: ${exc}" } } - def pytests = [:] - pytests['sqlite'] = { +} + +def pytests = [:] +pytests['sqlite'] = { + node { ws { deleteDir() unstash name: 'kallithea' @@ -87,8 +91,11 @@ node { } } } - if (isUnix()) { - pytests['de'] = { +} + +pytests['de'] = { + node { + if (isUnix()) { ws { deleteDir() unstash name: 'kallithea' @@ -113,7 +120,11 @@ node { junit 'pytest_de.xml' } } - pytests['mysql'] = { + } +} +pytests['mysql'] = { + node { + if (isUnix()) { ws { deleteDir() unstash name: 'kallithea' @@ -136,7 +147,11 @@ node { junit 'pytest_mysql.xml' } } - pytests['postgresql'] = { + } +} +pytests['postgresql'] = { + node { + if (isUnix()) { ws { deleteDir() unstash name: 'kallithea' @@ -160,7 +175,7 @@ node { } } } - stage('Tests') { - parallel pytests - } } +stage('Tests') { + parallel pytests +}