Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

circleci: upload artifacts when coverage is below threshold #2502

Merged
merged 2 commits into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion test/run_envoy_bazel_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ time "${GCOVR}" --gcov-exclude="${GCOVR_EXCLUDE_REGEX}" \
# run.
rm "${SRCDIR}"/test/coverage/BUILD

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only if the coverage dir doesn't exist? I often (locally) use bazel.coverage to generate reports, and will run it a number of times to validate the coverage status as I make code changes. Usually it just clobbers the previous report as currently implemented. In this PR, I think it would silently fail to update.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-z just check if the env ENVOY_COVERAGE_DIR is set, not checking if dir exists, if you run test/run_envoy_bazel_coverage.sh directly, this env var is not set.


COVERAGE_VALUE=$(grep -Po 'lines: \K(\d|\.)*' "${COVERAGE_SUMMARY}")
COVERAGE_THRESHOLD=98.0
COVERAGE_THRESHOLD=99.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revert this to 98.0 once I confirmed this actually works.

COVERAGE_FAILED=$(echo "${COVERAGE_VALUE}<${COVERAGE_THRESHOLD}" | bc)
if test ${COVERAGE_FAILED} -eq 1; then
echo Code coverage ${COVERAGE_VALUE} is lower than limit of ${COVERAGE_THRESHOLD}
Expand Down