Add test and coverage reports

This commit is contained in:
Peter 2020-12-27 12:16:06 +01:00
parent 81c4be6343
commit eaddf264ce
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
2 changed files with 6 additions and 1 deletions

View file

@ -9,6 +9,10 @@ test:
stage: test
script:
- task cli-cover-report
artifacts:
reports:
junit: out/report.xml
cobertura: out/coverage.xml
lint:
stage: test

View file

@ -46,8 +46,9 @@ tasks:
- generate
cmds:
- mkdir -p {{ .OUT_DIR }}
- go test -coverprofile={{ .OUT_DIR }}/cov-raw.out -v ./...
- go test -coverprofile={{ .OUT_DIR }}/cov-raw.out -covermode count -v ./... 2>&1 | go-junit-report > {{ .OUT_DIR }}/report.xml
- grep -v "generated" {{ .OUT_DIR }}/cov-raw.out > {{ .OUT_DIR }}/cov.out
- gocover-cobertura < {{ .OUT_DIR }}/cov.out > {{ .OUT_DIR }}/coverage.xml
- rm -f {{ .OUT_DIR }}/cov-raw.out
cli-cover-report: