# HG changeset patch # User domruf # Date 1491689597 -7200 # 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 -r 1ae319cb41b1 -r 8a60eb2b7603 Jenkinsfile --- a/Jenkinsfile Thu Apr 06 16:55:55 2017 +0300 +++ b/Jenkinsfile Sun Apr 09 00:13:17 2017 +0200 @@ -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 @@ echo "Caught: ${exc}" } } - def pytests = [:] - pytests['sqlite'] = { +} + +def pytests = [:] +pytests['sqlite'] = { + node { ws { deleteDir() unstash name: 'kallithea' @@ -87,8 +91,11 @@ } } } - if (isUnix()) { - pytests['de'] = { +} + +pytests['de'] = { + node { + if (isUnix()) { ws { deleteDir() unstash name: 'kallithea' @@ -113,7 +120,11 @@ junit 'pytest_de.xml' } } - pytests['mysql'] = { + } +} +pytests['mysql'] = { + node { + if (isUnix()) { ws { deleteDir() unstash name: 'kallithea' @@ -136,7 +147,11 @@ junit 'pytest_mysql.xml' } } - pytests['postgresql'] = { + } +} +pytests['postgresql'] = { + node { + if (isUnix()) { ws { deleteDir() unstash name: 'kallithea' @@ -160,7 +175,7 @@ } } } - stage('Tests') { - parallel pytests - } } +stage('Tests') { + parallel pytests +}