From 89cab96b3b1e3bb5ccf18e3e353c9bfb285e0ea9 Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Wed, 22 Aug 2018 18:22:02 -0700
Subject: [PATCH] Add JUnit report

---
 .gitlab-ci.yml | 3 +++
 Makefile       | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index de5a44a..4e6c773 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,6 +29,9 @@ unit_tests:
   stage: test
   script:
     - make test
+  artifacts:
+    reports:
+      junit: report.xml
 
 race_detector:
   stage: test
diff --git a/Makefile b/Makefile
index f3d51f5..3dc3828 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,9 @@ lint:
 	@golint -set_exit_status ${PKG_LIST}
 
 test:
+	@go get -u github.com/jstemmer/go-junit-report
 	@go test -v ${PKG_LIST}
+	@go test -v 2>&1 | go-junit-report > report.xml
 
 race: dep
 	@go test -v -race ${PKG_LIST}
@@ -27,9 +29,9 @@ coverhtml:
 
 dep:
 	@go get -v -d ./...
-	@go get github.com/mitchellh/gox
 
 build: dep
+	@go get github.com/mitchellh/gox
 	@gox -output="${CI_PROJECT_DIR}/${PROJECT_NAME}/{{.Dir}}_{{.OS}}_{{.Arch}}" -parallel=6
 
 clean:
-- 
GitLab