Skip to content

Commit

Permalink
Make tox run tests in series
Browse files Browse the repository at this point in the history
Works around a tox race condition when creating Python sdists.
Tox bug: tox-dev/tox#849
  • Loading branch information
samdbmg committed Jul 3, 2018
1 parent 1744bbb commit 58fe648
Showing 1 changed file with 40 additions and 36 deletions.
76 changes: 40 additions & 36 deletions Jenkinsfile
Expand Up @@ -51,43 +51,47 @@ pipeline {
}
}
}
stage ("Python 2.7 Unit Tests") {
steps {
script {
env.py27_result = "FAILURE"
}
bbcGithubNotify(context: "tests/py27", status: "PENDING")
withBBCRDPythonArtifactory {
// Use a workdirectory in /tmp to avoid shebang length limitation
sh 'tox -e py27 --recreate --workdir /tmp/$(basename ${WORKSPACE})/tox-py27'
}
script {
env.py27_result = "SUCCESS" // This will only run if the sh above succeeded
}
}
post {
always {
bbcGithubNotify(context: "tests/py27", status: env.py27_result)
}
}
}
stage ("Python 3 Unit Tests") {
steps {
script {
env.py3_result = "FAILURE"
}
bbcGithubNotify(context: "tests/py3", status: "PENDING")
withBBCRDPythonArtifactory {
// Use a workdirectory in /tmp to avoid shebang length limitation
sh 'tox -e py3 --recreate --workdir /tmp/$(basename ${WORKSPACE})/tox-py3'
}
script {
env.py3_result = "SUCCESS" // This will only run if the sh above succeeded
stage ("Python Unit Tests") {
stages {
stage ("Python 2.7 Unit Tests") {
steps {
script {
env.py27_result = "FAILURE"
}
bbcGithubNotify(context: "tests/py27", status: "PENDING")
withBBCRDPythonArtifactory {
// Use a workdirectory in /tmp to avoid shebang length limitation
sh 'tox -e py27 --recreate --workdir /tmp/$(basename ${WORKSPACE})/tox-py27'
}
script {
env.py27_result = "SUCCESS" // This will only run if the sh above succeeded
}
}
post {
always {
bbcGithubNotify(context: "tests/py27", status: env.py27_result)
}
}
}
}
post {
always {
bbcGithubNotify(context: "tests/py3", status: env.py3_result)
stage ("Python 3 Unit Tests") {
steps {
script {
env.py3_result = "FAILURE"
}
bbcGithubNotify(context: "tests/py3", status: "PENDING")
withBBCRDPythonArtifactory {
// Use a workdirectory in /tmp to avoid shebang length limitation
sh 'tox -e py3 --recreate --workdir /tmp/$(basename ${WORKSPACE})/tox-py3'
}
script {
env.py3_result = "SUCCESS" // This will only run if the sh above succeeded
}
}
post {
always {
bbcGithubNotify(context: "tests/py3", status: env.py3_result)
}
}
}
}
}
Expand Down

0 comments on commit 58fe648

Please sign in to comment.