From 58157ff310eb1c0968edf9a5c45db56a598f750b Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Thu, 7 Jul 2022 08:23:54 -0500 Subject: [PATCH] Adding jacoco coverage reporting --- pom.xml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index d2adfb84..aa639590 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,8 @@ 17 true true + true + 0.80 @@ -121,6 +123,10 @@ org.apache.maven.plugins maven-surefire-plugin 3.0.0-M5 + + + @{jaCoCoArgLine} + org.apache.maven.plugins @@ -174,23 +180,38 @@ org.jacoco jacoco-maven-plugin 0.8.8 + + + com/kingsrook/qqq/backend/core/model/**/*.class + com/kingsrook/qqq/backend/core/exceptions/**/*.class + + - jacoco-check + pre-unit-test + + prepare-agent + + + jaCoCoArgLine + + + + unit-test-check check + + ${coverage.haltOnFailure} - BUNDLE - INSTRUCTION COVEREDRATIO - 0.80 + ${coverage.instructionCoveredRatioMinimum} @@ -198,13 +219,43 @@ - report - prepare-package + post-unit-test + verify report + + + + + exec-maven-plugin + org.codehaus.mojo + 3.0.0 + + + test-coverage-summary + verify + + exec + - ${project.build.directory}/jacoco + sh + + -c + + /tmp/$$.headers +xpath -q -e '/html/body/table/tfoot/tr[1]/td/text()' target/site/jacoco/index.html > /tmp/$$.values +echo +echo "Jacoco coverage summary report:" +echo " See also target/site/jacoco/index.html" +echo " and https://www.jacoco.org/jacoco/trunk/doc/counters.html" +echo "------------------------------------------------------------" +paste /tmp/$$.headers /tmp/$$.values | tail +2 | awk -v FS='\t' '{printf("%-20s %s\n",$1,$2)}' +rm /tmp/$$.headers /tmp/$$.values + ]]> + +