Skip to content

Commit

Permalink
circleci: upload artifacts when coverage is below threshold (#2502)
Browse files Browse the repository at this point in the history
Run rsync before checking threshold so CircleCI can pick up the coverage report.

Risk Level: Low
Testing: local tested
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Lizan Zhou <[email protected]>
  • Loading branch information
lizan authored and htuch committed Feb 1, 2018
1 parent 6a2781e commit 6dbcbbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ elif [[ "$1" == "bazel.coverage" ]]; then
# directory. Wow.
cd "${ENVOY_BUILD_DIR}"
SRCDIR="${GCOVR_DIR}" "${ENVOY_SRCDIR}"/test/run_envoy_bazel_coverage.sh
rsync -av "${ENVOY_BUILD_DIR}"/bazel-envoy/generated/coverage/ "${ENVOY_COVERAGE_DIR}"
exit 0
elif [[ "$1" == "bazel.coverity" ]]; then
# Coverity Scan version 2017.07 fails to analyze the entirely of the Envoy
Expand Down
2 changes: 2 additions & 0 deletions test/run_envoy_bazel_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ time "${GCOVR}" --gcov-exclude="${GCOVR_EXCLUDE_REGEX}" \
# run.
rm "${SRCDIR}"/test/coverage/BUILD

[[ -z "${ENVOY_COVERAGE_DIR}" ]] || rsync -av "${COVERAGE_DIR}"/ "${ENVOY_COVERAGE_DIR}"

COVERAGE_VALUE=$(grep -Po 'lines: \K(\d|\.)*' "${COVERAGE_SUMMARY}")
COVERAGE_THRESHOLD=98.0
COVERAGE_FAILED=$(echo "${COVERAGE_VALUE}<${COVERAGE_THRESHOLD}" | bc)
Expand Down

0 comments on commit 6dbcbbb

Please sign in to comment.