File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 4040 exit 1
4141 fi
4242
43- # Extract coverage percentages (filter for ctr2 elements with % symbol only)
44- INSTRUCTION=$(grep -A10 '<td>Total</td>' target/site/jacoco/index.html | grep -E 'class="ctr2".*%' | sed -n '1p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
45- BRANCH=$(grep -A10 '<td>Total</td>' target/site/jacoco/index.html | grep -E 'class="ctr2".*%' | sed -n '2p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
43+ # Extract coverage percentages using awk for more reliable extraction
44+ COVERAGE_VALUES=$(grep -A10 '<td>Total</td>' target/site/jacoco/index.html | grep -E 'class="ctr2".*[0-9]+%' | sed -E 's/.*>([0-9]+)%<.*/\1/')
45+
46+ echo "Debug: All coverage values found:"
47+ echo "$COVERAGE_VALUES"
48+
49+ INSTRUCTION=$(echo "$COVERAGE_VALUES" | awk 'NR==1')
50+ BRANCH=$(echo "$COVERAGE_VALUES" | awk 'NR==2')
4651
4752 echo "📘 Instruction Coverage: ${INSTRUCTION:-0}%"
4853 echo "🌿 Branch Coverage: ${BRANCH:-0}%"
You can’t perform that action at this time.
0 commit comments