From a3d5c9c8d6a8a5e34fbf0e4e4594582c39938d63 Mon Sep 17 00:00:00 2001 From: Steffen Date: Sat, 30 May 2020 19:09:05 -0700 Subject: [PATCH] fix: parse line coverage only (#1) --- entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3d03284..9db177e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -9,11 +9,11 @@ FILTERED_COVERAGE_PATH='./lcov_filtered.info' if [ ! -z "$3" ]; then echo "Excluding $3 from coverage..." lcov --remove ${LCOV_PATH} $3 -o ${FILTERED_COVERAGE_PATH} - CODE_COVERAGE=$(lcov --list ${FILTERED_COVERAGE_PATH} | sed -n "s/.*Total:|\(.*\)%.*/\1/p") + CODE_COVERAGE=$(lcov --list ${FILTERED_COVERAGE_PATH} | sed -n "s/.*Total:|\([^%]*\)%.*/\1/p") else - CODE_COVERAGE=$(lcov --list ${LCOV_PATH} | sed -n "s/.*Total:|\(.*\)%.*/\1/p") + CODE_COVERAGE=$(lcov --list ${LCOV_PATH} | sed -n "s/.*Total:|\([^%]*\)%.*/\1/p") fi echo "Minumum Coverage Required: ${MINIMUM_COVERAGE}%" echo "Current Code Coverage: ${CODE_COVERAGE}%" -if (( $(echo "$CODE_COVERAGE < $2" | bc) )); then exit 1; fi \ No newline at end of file +if (( $(echo "$CODE_COVERAGE < $2" | bc) )); then exit 1; fi