diff --git a/Jenkinsfile b/Jenkinsfile index 9c12dd3..2b8f211 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,10 +2,18 @@ pipeline { agent any + options { disableConcurrentBuilds() } + environment { + TMPDIR = "/tmp/$BUILD_TAG" + } stages { stage('Unit Tests') { steps { - sh 'tox -rv' + sh "mkdir ${env.TMPDIR}" + sh """ +virtualenv -p python3 ${env.TMPDIR}/venv/ +${env.TMPDIR}/venv/bin/pip install tox +PGPORT=`python -c 'import struct; import socket; s=socket.socket(); s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack("ii", 1, 0)); s.bind(("", 0)); print(s.getsockname()[1]); s.close()'` pg_virtualenv -o fsync=off ${env.TMPDIR}/venv/bin/tox -r""" } post { always { @@ -15,7 +23,7 @@ pipeline { utils.publish_coverage_native('index.html') utils.publish_pylint('pylint.out') } - junit '*_results.xml' + mergeJunitResults() } } } @@ -37,6 +45,7 @@ pipeline { } } success { + sh "rm -rf ${env.TMPDIR}" cleanWs() } }