From 92d904150a6f1086404101cae90842d36a04cba2 Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Fri, 21 Oct 2022 14:52:26 -0700 Subject: [PATCH 1/2] Add better reporting on unit tests --- .gitlab-ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1cd0d50..5c50c8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,8 +11,15 @@ test: - main - merge_requests script: - - go test -race ./... - + - go install + - go test -coverprofile=coverage.txt -covermode=atomic -race ./... + - go get github.com/boumenot/gocover-cobertura + - go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage.xml push: stage: push rules: From 466de2d9c627060aaa84ab86e2c5799ff28100bf Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Fri, 21 Oct 2022 14:54:00 -0700 Subject: [PATCH 2/2] Let the test handler take care of installing stuff --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c50c8f..fc59a1b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,6 @@ test: - main - merge_requests script: - - go install - go test -coverprofile=coverage.txt -covermode=atomic -race ./... - go get github.com/boumenot/gocover-cobertura - go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml