Fix Add absolute branch coverage check
Check for absolute number of missed branches in github workflow instead
of checking a percentage.
Ensure that the number of missed branches does not increase from the
current 4 missed branches.
@@ -39,3 +39,17 @@ jobs:
echo "Lacks 100.0% line unit test coverage"
exit -1
fi
+
+ - name: Confirm absolute line coverage
+ run: |
+ # Current best possible branch coverage is all but 4, with associated issues for each missing case
+ missed_branches=4
+ coverage_nums=$(grep -A 3 "Overall coverage rate" lcov_out.txt | grep branches | grep -oP "[1-9]+[0-9]*")
+
+ diff=$(echo $coverage_nums | awk '{ print $4 - $3 }')
+ if [ $(($diff > $missed_branches)) == 1 ]
+ then
+ grep -A 3 "Overall coverage rate" lcov_out.txt
+ echo "More than $missed_branches branches missed"
+ exit -1
+ fi
