@@ -70,29 +70,40 @@ test:
70
70
- << : *cache-defaults
71
71
variables :
72
72
GOTESTSUM_VERSION : v1.12.0
73
+ GOCOVER_COBERTURA_VERSION : v1.3.0
73
74
before_script :
75
+ - echo -e "\e[0Ksection_start:$(date +%s):script_step_before\r\e[0KRunning script_step_before"
74
76
- | # Download gotestsum binary
75
- echo -e "\e[0Ksection_start:$(date +%s):script_step_before\r\e[0KRunning script_step_before"
76
77
curl -sSfL https://github.com/gotestyourself/gotestsum/releases/download/${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION#v}_linux_amd64.tar.gz -o /tmp/gotestsum.tar.gz
77
78
mkdir -p ${GOPATH}/bin
78
79
tar -C ${GOPATH}/bin/ -zxof /tmp/gotestsum.tar.gz gotestsum
79
- echo -e "\e[0Ksection_end:$(date +%s):script_step_before\r\e[0K"
80
+ - | # Install gocover-cobertura
81
+ go install github.com/boumenot/gocover-cobertura@${GOCOVER_COBERTURA_VERSION}
82
+ - echo -e "\e[0Ksection_end:$(date +%s):script_step_before\r\e[0K"
80
83
script :
81
84
- |
82
85
# Run tests
83
86
echo -e "\e[0Ksection_start:$(date +%s):script_step_run\r\e[0KRunning script_step_run"
84
87
${GOPATH}/bin/gotestsum \
85
- --junitfile report .xml --format testname \
88
+ --junitfile=junit .xml --format= testname \
86
89
-- \
87
- -coverprofile coverage.txt -covermode=atomic \
90
+ -coverprofile=cover.out -covermode=atomic \
88
91
./...
89
92
echo -e "\e[0Ksection_end:$(date +%s):script_step_run\r\e[0K"
93
+ after_script :
94
+ - echo -e "\e[0Ksection_start:$(date +%s):script_step_after\r\e[0KRunning script_step_after"
95
+ - ${GOPATH}/bin/gocover-cobertura < cover.out > cobertura-coverage.xml
96
+ - echo -e "\e[0Ksection_end:$(date +%s):script_step_after\r\e[0K"
90
97
artifacts :
91
98
when : always
92
99
paths :
93
- - report.xml
100
+ - junit.xml
101
+ - cobertura-coverage.xml
94
102
reports :
95
- junit : report.xml
103
+ junit : junit.xml
104
+ coverage_report :
105
+ coverage_format : cobertura
106
+ path : cobertura-coverage.xml
96
107
97
108
release :
98
109
stage : release
0 commit comments