From 58dbcfd42bef07c4f86268407fd3cfacc8bfe3a0 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Wed, 2 Jul 2025 13:06:20 -0500 Subject: [PATCH] manual rewrite of jacoco summary reporting shell lines --- pom.xml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index a09cd325..a69a3ce8 100644 --- a/pom.xml +++ b/pom.xml @@ -251,22 +251,19 @@ echo "------------------------------------------------------------" # Parse Jacoco HTML coverage summary using grep and sed if [ -f target/site/jacoco/index.html ]; then - echo "Element\nInstructions Missed\nInstruction Coverage\nBranches Missed\nBranch Coverage\nComplexity Missed\nComplexity Hit\nLines Missed\nLines Hit\nMethods Missed\nMethods Hit\nClasses Missed\nClasses Hit\n" > /tmp/$$.headers + echo -e "Instructions Missed\nInstruction Coverage\nBranches Missed\nBranch Coverage\nComplexity Missed\nComplexity Hit\nLines Missed\nLines Hit\nMethods Missed\nMethods Hit\nClasses Missed\nClasses Hit\n" > /tmp/$$headers # Extract values from the footer row of the coverage table - grep -A 12 '' target/site/jacoco/index.html | grep '' | sed 's/\([^<]*\)<\/td>/\1/' | tr '\n' '\t' | sed 's/\t$/\n/' > /tmp/$$.values + sed 's/<\/\w\+>/&\n/g' target/site/jacoco/index.html | grep -A 12 '' | grep '\([^<]*\)<\/td>/\1/' | grep -v Total > /tmp/$$.values paste /tmp/$$.headers /tmp/$$.values | tail +2 | awk -v FS='\t' '{printf("%-20s %s\n",$1,$2)}' rm /tmp/$$.headers /tmp/$$.values else - echo "Jacoco coverage summary could not be parsed..."; + echo "Jacoco coverage summary was not found."; fi echo "Untested classes, per Jacoco:" echo "-----------------------------" # Parse Jacoco XML reports directly to find classes with 0% coverage -find target/site/jacoco -name "jacoco.xml" -exec grep -l '/&\n/g;s/<\/class>/&\n/g' target/site/jacoco/jacoco.xml | grep -v 'counter type="CLASS" missed="0"' | sed 's/>.*//;s/.*\///;s/".*//' echo ]]>