Skip to content

Instantly share code, notes, and snippets.

@evasilchenko
Created December 16, 2016 04:21
Show Gist options
  • Save evasilchenko/5feedcc9cc31b4bb2347c5f8bc475702 to your computer and use it in GitHub Desktop.
Save evasilchenko/5feedcc9cc31b4bb2347c5f8bc475702 to your computer and use it in GitHub Desktop.
stage ("Run Unit/Integration Tests") {
def testsError = null
try {
sh '''
source ../bin/activate
python <relative path to manage.py> jenkins
deactivate
'''
}
catch(err) {
testsError = err
currentBuild.result = 'FAILURE'
}
finally {
junit 'reports/junit.xml'
if (testsError) {
throw testsError
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment