File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 4040 exit 1
4141 fi
4242
43- # Extract coverage percentages (handles both whole numbers and decimals )
44- INSTRUCTION=$(grep -A4 " Total" target/site/jacoco/index.html | grep -E 'class="ctr2"' | sed -n '1p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
45- BRANCH=$(grep -A4 " Total" target/site/jacoco/index.html | grep -E 'class="ctr2"' | sed -n '2p' | sed -E 's/.*>([0-9]+)%<.*/\1/')
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/')
4646
4747 echo "📘 Instruction Coverage: ${INSTRUCTION:-0}%"
4848 echo "🌿 Branch Coverage: ${BRANCH:-0}%"
You can’t perform that action at this time.
0 commit comments