From ecb97db91378d64d8c21d2694f15f61768eba2e1 Mon Sep 17 00:00:00 2001 From: Ta-Ching Chen Date: Wed, 11 Sep 2019 14:52:45 +0800 Subject: [PATCH] Integrate with Codecov (#1308) --- .travis.yml | 1 + hack/runtests.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7d146a5..76d4f045 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,6 +54,7 @@ before_cache: - test/save_cache.sh # save docker cache after_script: + - bash <(curl -s https://codecov.io/bash) - kubectl --namespace default delete configmap -l travisID=${TRAVIS_BUILD_ID} # remove in-test configmap to indicate this CI build finished notifications: diff --git a/hack/runtests.sh b/hack/runtests.sh index cd396fd2..19a30389 100755 --- a/hack/runtests.sh +++ b/hack/runtests.sh @@ -20,8 +20,17 @@ else fi fi -go test -v -i $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v 'benchmark') +set +x + +# for codecov +echo "" > coverage.txt # The executor unit test only works with NodePort-type services for # now. So disable it for our travis ci tests. -go test -v $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v executor | grep -v 'benchmark') +for d in $(go list ./... | grep -v '/vendor/' | grep -v 'examples/go' | grep -v executor | grep -v 'benchmark'); do + go test -v -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done