Produce a combined coverage report when running Go unit tests.

The Go coverage tool does not currently support recording a coverage
data profile across packages, so we must manually combine these coverage
profiles and use it to produce an HTML report when KUBE_COVER is
nonempty. The exact value of KUBE_COVER is now ignored; KUBE_COVERMODE
can be used to set the coverage mode from the default of "atomic".

Additionally, if KUBE_GOVERALLS_BIN is set, hack/test-go.sh will attempt
to report coverage results to Coveralls.io. This is intended to be used
with the Travis build.
This commit is contained in:
Jeff Grafton
2015-02-18 17:28:52 -08:00
parent 079e70e210
commit 26addee75b
2 changed files with 58 additions and 34 deletions

View File

@@ -20,4 +20,4 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
KUBE_COVER=" " KUBE_RACE=" " "${KUBE_ROOT}/hack/test-go.sh" "" -test.run="^X" -benchtime=1s -bench=. -benchmem
KUBE_COVER="" KUBE_RACE=" " "${KUBE_ROOT}/hack/test-go.sh" "" -test.run="^X" -benchtime=1s -bench=. -benchmem