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:
commit
df7836df62
4 files changed
+18
-3
No files matched your search
@@ -23,6 +23,8 @@ _testmain.go
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
profile.cov
|
||||
coverage.html
|
||||
|
||||
# Emacs backup files
|
||||
*~
|
||||
|
||||
+6
-1
@@ -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
|
||||
@@ -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,6 +1,6 @@
|
||||
# Weave - the Docker network
|
||||
|
||||
[](https://travis-ci.org/zettio/weave)
|
||||
[](https://travis-ci.org/zettio/weave) [](https://coveralls.io/r/zettio/weave)
|
||||
|
||||
Weave creates a virtual network that connects Docker containers
|
||||
deployed across multiple hosts.
|
||||
|
||||
Reference in new issue
Block a user