Skip to content

Instantly share code, notes, and snippets.

@jbleduigou
Created February 19, 2020 21:02
Show Gist options
  • Save jbleduigou/0dfb76d2bf9a1d9b9e79073b32763e67 to your computer and use it in GitHub Desktop.
Save jbleduigou/0dfb76d2bf9a1d9b9e79073b32763e67 to your computer and use it in GitHub Desktop.
stage('Test') {
steps {
// Retrieve tool for converting output to junit format
sh 'go get -u github.com/jstemmer/go-junit-report'
// Run unit tests and redirect output to go-junit-report
sh 'cd $GOPATH/src/github/jbleduigou/budgetcategorizer && go test -v ./... 2>&1 | go-junit-report > report.xml'
}
post {
always {
// Publish test results
step([$class: 'JUnitResultArchiver', testResults: 'report.xml'])
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment