From 19ca156c910486047ccf737258904aacd6b05ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Lipt=C3=A1k?= Date: Wed, 11 Jan 2017 17:51:06 -0500 Subject: [PATCH] Enable codecov.io MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gábor Lipták --- .travis.yml | 3 +++ Makefile | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec20eb0..3e1f7ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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) diff --git a/Makefile b/Makefile index 4fb65bc..0f338ac 100644 --- a/Makefile +++ b/Makefile @@ -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