Skip to content

Instantly share code, notes, and snippets.

@Azadehkhojandi
Created October 25, 2018 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Azadehkhojandi/64683cdc6e72618870dc101499c6c312 to your computer and use it in GitHub Desktop.
Save Azadehkhojandi/64683cdc6e72618870dc101499c6c312 to your computer and use it in GitHub Desktop.
running go tests and export the results for azure devops
echo "get the go-junit-report package"
go get -u github.com/jstemmer/go-junit-report
echo "run the tests"
go test -v ./tests 2>&1 > go-test-result && exitCode=$? || exitCode=$?
echo "Write the result.xml file"
cat go-test-result | $(GOBIN)/go-junit-report > report.xml
echo "result: $exitCode"
exit $exitCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment