Enable codecov.io

Signed-off-by: Gábor Lipták <gliptak@gmail.com>
This commit is contained in:
Gábor Lipták 2017-01-11 17:51:06 -05:00
parent 3c44ec5dbc
commit 19ca156c91
2 changed files with 15 additions and 3 deletions

View file

@ -23,3 +23,6 @@ script:
- make binaries
- make coverage
- sudo PATH=$PATH GOPATH=$GOPATH make root-coverage
after_success:
- bash <(curl -s https://codecov.io/bash)

View file

@ -128,9 +128,18 @@ uninstall:
coverage: ## generate coverprofiles from the unit tests, except tests that require root
@echo "🐳 $@"
@( for pkg in $(filter-out ${INTEGRATION_PACKAGE},${PACKAGES}); do \
go test -i ${TESTFLAGS} -test.short -coverprofile="../../../$$pkg/coverage.txt" -covermode=atomic $$pkg || exit; \
go test ${TESTFLAGS} -test.short -coverprofile="../../../$$pkg/coverage.txt" -covermode=atomic $$pkg || exit; \
@rm -f coverage.txt
( for pkg in $(filter-out ${INTEGRATION_PACKAGE},${PACKAGES}); do \
go test -i ${TESTFLAGS} -test.short -coverprofile=coverage.out -covermode=atomic $$pkg || exit; \
if [ -f profile.out ]; then \
cat profile.out >> coverage.txt; \
rm profile.out; \
fi; \
go test ${TESTFLAGS} -test.short -coverprofile=coverage.out -covermode=atomic $$pkg || exit; \
if [ -f profile.out ]; then \
cat profile.out >> coverage.txt; \
rm profile.out; \
fi; \
done )
root-coverage: ## generae coverage profiles for the unit tests