Use the makefile targets for running the test in CircleCI. Push

coverage output to codecov.

Signed-off-by: Ying Li <ying.li@docker.com>
This commit is contained in:
Ying Li 2015-10-20 14:20:41 -07:00
parent a858a4f362
commit 4e24d49ab2
2 changed files with 10 additions and 15 deletions

View File

@ -87,9 +87,9 @@ gen-cover:
@rm -rf "$(COVERDIR)" @rm -rf "$(COVERDIR)"
@mkdir -p "$(COVERDIR)" @mkdir -p "$(COVERDIR)"
$(foreach PKG,$(PKGS),$(call gocover,$(PKG))) $(foreach PKG,$(PKGS),$(call gocover,$(PKG)))
@echo "mode: $(COVERMODE)" > "$(COVERPROFILE)"
cover: gen-cover cover: gen-cover
@echo "mode: $(COVERMODE)" > "$(COVERPROFILE)"
@grep -h -v "^mode:" "$(COVERDIR)"/*.cover >> "$(COVERPROFILE)" @grep -h -v "^mode:" "$(COVERDIR)"/*.cover >> "$(COVERPROFILE)"
@go tool cover -func="$(COVERPROFILE)" @go tool cover -func="$(COVERPROFILE)"
@go tool cover -html="$(COVERPROFILE)" @go tool cover -html="$(COVERPROFILE)"
@ -100,7 +100,6 @@ define formatcov
endef endef
ci: OPTS = race test.short ci: OPTS = race test.short
GO_EXC = godep go
ci: gen-cover ci: gen-cover
aggregate-cover: aggregate-cover:

View File

@ -38,7 +38,7 @@ dependencies:
# For the stable go version, additionally install linting tools # For the stable go version, additionally install linting tools
- > - >
gvm use stable && gvm use stable &&
go get github.com/axw/gocov/gocov github.com/mattn/goveralls github.com/golang/lint/golint go get github.com/axw/gocov/gocov github.com/golang/lint/golint
test: test:
pre: pre:
# Output the go versions we are going to test # Output the go versions we are going to test
@ -58,18 +58,14 @@ test:
override: override:
# Test stable, and report # Test stable, and report
# Preset the goverall report file - gvm use stable && make ci:
- echo "$CIRCLE_PAIN" > ~/goverage.report
- gvm use stable; go list ./... | xargs -L 1 -I{} rm -f $GOPATH/src/{}/coverage.out:
pwd: $BASE_STABLE
- gvm use stable; go list ./... | xargs -L 1 -I{} godep go test -race -test.short -coverprofile=$GOPATH/src/{}/coverage.out {}:
timeout: 600 timeout: 600
pwd: $BASE_STABLE pwd: $BASE_STABLE
# post: post:
# Aggregate and report to coveralls # Aggregate and report to codecov.io
# - gvm use stable; go list ./... | xargs -L 1 -I{} cat "$GOPATH/src/{}/coverage.out" | grep -v "$CIRCLE_PAIN" >> ~/goverage.report: - make aggregate-cover:
# pwd: $BASE_STABLE pwd: $BASE_STABLE
# - gvm use stable; goveralls -service circleci -coverprofile=/home/ubuntu/goverage.report -repotoken $COVERALLS_TOKEN:
# pwd: $BASE_STABLE - bash <(curl -s https://codecov.io/bash):
pwd: $BASE_STABLE