Merge pull request #505 from tomwilkie/coverage

Move away from recursive go test, as it cannot output a merged coverage profile.
This commit is contained in:
rade committed 2015-04-01 13:23:19 +01:00
commit df7836df62
4 files changed
+18 -3

No files matched your search

+2
View File
@@ -23,6 +23,8 @@ _testmain.go
*.exe
*.test
*.prof
profile.cov
coverage.html
# Emacs backup files
*~
+6 -1
View File
@@ -13,4 +13,9 @@ install:
- go install -tags netgo std
- make travis
script: make tests
script:
- make tests
after_success:
- go get github.com/mattn/goveralls
- $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci
+9 -1
View File
@@ -61,7 +61,15 @@ $(DOCKER_DISTRIB):
curl -o $(DOCKER_DISTRIB) $(DOCKER_DISTRIB_URL)
tests:
go test -cover -tags netgo ./...
echo "mode: count" > profile.cov
for dir in $$(find . -type f -name '*_test.go' | xargs -n1 dirname | sort -u); do \
go test -tags netgo -covermode=count -coverprofile=$$dir/profile.tmp $$dir; \
if [ -f $$dir/profile.tmp ]; then \
cat $$dir/profile.tmp | tail -n +2 >> profile.cov; \
rm $$dir/profile.tmp; \
fi \
done
go tool cover -html=profile.cov -o=coverage.html
$(PUBLISH): publish_%:
$(SUDO) docker tag -f $(DOCKERHUB_USER)/$* $(DOCKERHUB_USER)/$*:$(WEAVE_VERSION)
+1 -1
View File
@@ -1,6 +1,6 @@
# Weave - the Docker network
[![Build Status](https://travis-ci.org/zettio/weave.svg?branch=master)](https://travis-ci.org/zettio/weave)
[![Build Status](https://travis-ci.org/zettio/weave.svg?branch=master)](https://travis-ci.org/zettio/weave) [![Coverage Status](https://coveralls.io/repos/zettio/weave/badge.svg)](https://coveralls.io/r/zettio/weave)
Weave creates a virtual network that connects Docker containers
deployed across multiple hosts.