Skip to content

Commit

Permalink
chores(makefile): add ut coverage for make test (#1272)
Browse files Browse the repository at this point in the history
* chores(makefile): add ut coverage for make test

* polish for make test

* remove -cover as it will automatically set by -coverprofile
  • Loading branch information
supereagle authored and caicloud-bot committed Sep 3, 2019
1 parent 967a268 commit 9769fe4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Makefile
Expand Up @@ -48,9 +48,6 @@ SCENE ?= cicd
# These variables should not need tweaking.
#

# A list of all packages.
PKGS := $(shell go list ./... | grep -v /vendor | grep -v /test)

# Project main package location (can be multiple ones).
CMD_DIR := ./cmd

Expand Down Expand Up @@ -90,7 +87,8 @@ $(GOMETALINTER):
gometalinter --install &> /dev/null

test:
go test $(PKGS)
@go test $$(go list ./... | grep -v /vendor | grep -v /test) -coverprofile=coverage.out
@go tool cover -func coverage.out | tail -n 1 | awk '{ print "Total coverage: " $$3 }'

build-local:
@for target in $(TARGETS); do \
Expand Down

0 comments on commit 9769fe4

Please sign in to comment.