Created
March 11, 2015 16:28
-
-
Save dpetersen/b054edc91163af8af590 to your computer and use it in GitHub Desktop.
CircleCI junit integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 744cfc17ad795077a427b19d02c10e4f0b5008b7 | |
Author: Don Petersen <[email protected]> | |
Date: Tue Mar 10 15:43:22 2015 -0600 | |
Include circle-compatible test output. | |
diff --git a/circle.yml b/circle.yml | |
index a2763cf..ece9b30 100644 | |
--- a/circle.yml | |
+++ b/circle.yml | |
@@ -9,5 +9,17 @@ dependencies: | |
- ls | |
test: | |
+ pre: | |
+ - mkdir -p $CIRCLE_TEST_REPORTS/gotest | |
+ | |
override: | |
- - docker run -v $(pwd):/src dpetersen/golang-tester | |
+ # Run the tests: | |
+ # 1) Using golang-tester to honor godeps. | |
+ # 2) Preserving STDOUT while saving output to a file for processing. | |
+ # 3) Preserving the original exit code of 'go test'. | |
+ - docker run -v $(pwd):/src dpetersen/golang-tester 2>&1 | tee $CIRCLE_TEST_REPORTS/gotest/original.txt ; test ${PIPESTATUS[0]} -eq 0 | |
+ | |
+ post: | |
+ - mkdir -p $CIRCLE_TEST_REPORTS/gotest | |
+ - go get -v github.com/jstemmer/go-junit-report | |
+ - cat $CIRCLE_TEST_REPORTS/gotest/original.txt | go-junit-report > $CIRCLE_TEST_REPORTS/gotest/junit.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment