diff options
author | Takuya Noguchi <takninnovationresearch@gmail.com> | 2020-06-05 01:25:45 +0900 |
---|---|---|
committer | Takuya Noguchi <takninnovationresearch@gmail.com> | 2020-06-06 23:18:35 +0900 |
commit | 7703f3507623172726df1a41254d70b182e3fcd3 (patch) | |
tree | 65a1699105ffe1831bde36ecd8899690534b5756 /Makefile | |
parent | c086476dd1d0c147217c6a2877fa60d2dd799a15 (diff) | |
download | gitlab-shell-7703f3507623172726df1a41254d70b182e3fcd3.tar.gz |
Extract coverage for Go code on CI pipelinego-coverage
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,4 +1,4 @@ -.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang setup _install build compile check clean +.PHONY: validate verify verify_ruby verify_golang test test_ruby test_golang coverage coverage_golang setup _install build compile check clean GO_SOURCES := $(shell find . -name '*.go') @@ -19,11 +19,16 @@ test_ruby: bundle exec rspec --color --format d spec test_golang: - go test ./... + go test -cover -coverprofile=cover.out ./... test_golang_race: go test -race ./... +coverage: coverage_golang + +coverage_golang: + [ -f cover.out ] && go tool cover -func cover.out + setup: _install bin/gitlab-shell _install: |