Enable reporting test coverage to Coveralls from Shippable

However, enable coverage collection only on merges - not on pull
requests.
This commit is contained in:
Jeff Grafton
2015-08-19 15:48:43 -07:00
parent bce79d1368
commit 6f548cf5be
2 changed files with 23 additions and 4 deletions

View File

@@ -204,8 +204,12 @@ runTests() {
}
reportCoverageToCoveralls() {
if [[ -x "${KUBE_GOVERALLS_BIN}" ]]; then
${KUBE_GOVERALLS_BIN} -coverprofile="${COMBINED_COVER_PROFILE}" || true
if [[ ${KUBE_COVER} =~ ^[yY]$ ]] && [[ -x "${KUBE_GOVERALLS_BIN}" ]]; then
kube::log::status "Reporting coverage results to Coveralls for service ${CI_NAME:-}"
${KUBE_GOVERALLS_BIN} -coverprofile="${COMBINED_COVER_PROFILE}" \
${CI_NAME:+"-service=${CI_NAME}"} \
${COVERALLS_REPO_TOKEN:+"-repotoken=${COVERALLS_REPO_TOKEN}"} \
|| true
fi
}