Merge pull request #413 from gliptak/coverage1

Enable codecov.io
This commit is contained in:
Michael Crosby 2017-01-27 11:52:40 -08:00 committed by GitHub
commit dd866d6569
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