From 82ba3b4968cb096c3e9f967cf30cf06c73d3a7d6 Mon Sep 17 00:00:00 2001 From: Stephan Zuercher Date: Tue, 16 Jul 2019 22:45:13 -0700 Subject: [PATCH] build: fix coverage upload Risk Level: low Testing: n/a Docs Changes: n/a Release Notes: n/a Signed-off-by: Stephan Zuercher --- ci/coverage_publish.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ci/coverage_publish.sh b/ci/coverage_publish.sh index a1e08fbc4e957..622567a31f71a 100755 --- a/ci/coverage_publish.sh +++ b/ci/coverage_publish.sh @@ -8,19 +8,21 @@ if [ "${CIRCLECI}" != "true" ]; then exit 0 fi +[[ -z "${ENVOY_BUILD_DIR}" ]] && ENVOY_BUILD_DIR=/build +COVERAGE_FILE="${ENVOY_BUILD_DIR}/envoy/generated/coverage/index.html" + +if [ ! -f "${COVERAGE_FILE}" ]; then + echo "ERROR: Coverage file not found." + exit 1 +fi + +echo "Found coverage report: ${COVERAGE_FILE}" + # available for master builds if [ -z "$CIRCLE_PR_NUMBER" ] then echo "Uploading coverage report..." - [[ -z "${ENVOY_BUILD_DIR}" ]] && ENVOY_BUILD_DIR=/build - COVERAGE_FILE="${ENVOY_BUILD_DIR}/envoy/generated/coverage/coverage.html" - - if [ ! -f "${COVERAGE_FILE}" ]; then - echo "ERROR: Coverage file not found." - exit 1 - fi - BRANCH_NAME="${CIRCLE_BRANCH}" COVERAGE_DIR="$(dirname "${COVERAGE_FILE}")" S3_LOCATION="lyft-envoy/coverage/report-${BRANCH_NAME}"