Add test and coverage reports
This commit is contained in:
parent
81c4be6343
commit
eaddf264ce
2 changed files with 6 additions and 1 deletions
|
@ -9,6 +9,10 @@ test:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- task cli-cover-report
|
- task cli-cover-report
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
junit: out/report.xml
|
||||||
|
cobertura: out/coverage.xml
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
stage: test
|
stage: test
|
||||||
|
|
|
@ -46,8 +46,9 @@ tasks:
|
||||||
- generate
|
- generate
|
||||||
cmds:
|
cmds:
|
||||||
- mkdir -p {{ .OUT_DIR }}
|
- 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
|
- 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
|
- rm -f {{ .OUT_DIR }}/cov-raw.out
|
||||||
|
|
||||||
cli-cover-report:
|
cli-cover-report:
|
||||||
|
|
Loading…
Reference in a new issue