From 73001f6a64b3548a9584acc8c4bfe3a7806917e7 Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Fri, 17 Sep 2021 15:07:38 +0100 Subject: Fix SonarQube (jacoco) code coverage reporting - Add report module for aggregating (as per jacocos current recommendation)( - increased overall (cps-parent) minimum code coverage to 0.97 - set lower minimum in modules that are not at that level (yet) - add exclude for cps-events generated code - made xml identing consistentent some pom files Issue-ID: CPS-475 Signed-off-by: ToineSiebelink Change-Id: If7b7839d7e03522575bc76a2253b613e63400b6b --- cps-application/pom.xml | 2 +- cps-events/pom.xml | 11 +- cps-ncmp-rest/pom.xml | 254 +++++++++++++++++++++++------------------------ cps-ncmp-service/pom.xml | 92 ++++++++--------- cps-parent/pom.xml | 31 +----- cps-service/pom.xml | 4 + jacoco-report/pom.xml | 94 ++++++++++++++++++ pom.xml | 1 + 8 files changed, 277 insertions(+), 212 deletions(-) create mode 100644 jacoco-report/pom.xml diff --git a/cps-application/pom.xml b/cps-application/pom.xml index dfa469745e..9c6945a5fe 100755 --- a/cps-application/pom.xml +++ b/cps-application/pom.xml @@ -37,7 +37,7 @@ org.onap.cps.Application 2.8.0 yyyyMMdd'T'HHmmss'Z' - 0.7 + 0.82 ${docker.pull.registry}/onap/integration-java11:8.0.0 ${project.version}-${maven.build.timestamp} diff --git a/cps-events/pom.xml b/cps-events/pom.xml index 3dc5f1e0ac..6f51479bb0 100644 --- a/cps-events/pom.xml +++ b/cps-events/pom.xml @@ -62,16 +62,7 @@ true - - org.jacoco - jacoco-maven-plugin - - - org/onap/cps/event/model/* - - - - \ No newline at end of file + diff --git a/cps-ncmp-rest/pom.xml b/cps-ncmp-rest/pom.xml index e77ede50dc..2c44c24807 100644 --- a/cps-ncmp-rest/pom.xml +++ b/cps-ncmp-rest/pom.xml @@ -33,133 +33,133 @@ cps-ncmp-rest - - 0.5 - + + 0.95 + - - - ${project.groupId} - cps-ncmp-service - ${project.version} - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.boot - spring-boot-starter-jetty - - - io.swagger.core.v3 - swagger-annotations - - - - org.codehaus.groovy - groovy - test - - - org.codehaus.groovy - groovy-json - test - - - org.spockframework - spock-core - test - - - org.spockframework - spock-spring - test - - - cglib - cglib-nodep - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - com.google.code.gson - gson - - + + + ${project.groupId} + cps-ncmp-service + ${project.version} + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-jetty + + + io.swagger.core.v3 + swagger-annotations + + + + org.codehaus.groovy + groovy + test + + + org.codehaus.groovy + groovy-json + test + + + org.spockframework + spock-core + test + + + org.spockframework + spock-spring + test + + + cglib + cglib-nodep + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + com.google.code.gson + gson + + - - - - - io.swagger.codegen.v3 - swagger-codegen-maven-plugin - - - code-gen - - generate - - - ${project.basedir}/docs/openapi/openapi.yml - org.onap.cps.ncmp.rest.controller - org.onap.cps.ncmp.rest.model - org.onap.cps.ncmp.rest.api - spring - false - - src/gen/java - java11 - true - true - - - - - - - maven-resources-plugin - - - copy-resources - compile - - copy-resources - - - ${project.basedir}/target/classes/static/api-docs/cps-ncmp - - - ${project.basedir}/target/generated-sources/swagger/ - - openapi.yaml - - - - - - - - - + + + + + io.swagger.codegen.v3 + swagger-codegen-maven-plugin + + + code-gen + + generate + + + ${project.basedir}/docs/openapi/openapi.yml + org.onap.cps.ncmp.rest.controller + org.onap.cps.ncmp.rest.model + org.onap.cps.ncmp.rest.api + spring + false + + src/gen/java + java11 + true + true + + + + + + + maven-resources-plugin + + + copy-resources + compile + + copy-resources + + + ${project.basedir}/target/classes/static/api-docs/cps-ncmp + + + ${project.basedir}/target/generated-sources/swagger/ + + openapi.yaml + + + + + + + + + diff --git a/cps-ncmp-service/pom.xml b/cps-ncmp-service/pom.xml index 294b290161..0ee81c784c 100644 --- a/cps-ncmp-service/pom.xml +++ b/cps-ncmp-service/pom.xml @@ -22,53 +22,53 @@ -4.0.0 - - org.onap.cps - cps-parent - 2.0.1-SNAPSHOT - ../cps-parent/pom.xml - + 4.0.0 + + org.onap.cps + cps-parent + 2.0.1-SNAPSHOT + ../cps-parent/pom.xml + -cps-ncmp-service + cps-ncmp-service - - 0.7 - + + 0.87 + - - - ${project.groupId} - cps-service - - - org.spockframework - spock-core - test - - - org.spockframework - spock-spring - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - org.springframework - spring-web - - - org.springframework.boot - spring-boot-starter-validation - - + + + ${project.groupId} + cps-service + + + org.spockframework + spock-core + test + + + org.spockframework + spock-spring + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.springframework + spring-web + + + org.springframework.boot + spring-boot-starter-validation + + diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml index 3de50c3c14..3c2eab5e0f 100755 --- a/cps-parent/pom.xml +++ b/cps-parent/pom.xml @@ -38,24 +38,11 @@ org.onap.cps.Application 11 - 0.9 + 0.97 ${project.reporting.outputDirectory}/jacoco-aggregate - ../cps-ri/target/site/jacoco-ut/jacoco.xml, - ../cps-ri/target/site/jacoco-aggregate/jacoco.xml, - ../cps-service/target/site/jacoco-ut/jacoco.xml, - ../cps-service/target/site/jacoco-aggregate/jacoco.xml, - ../cps-rest/target/site/jacoco-ut/jacoco.xml, - ../cps-rest/target/site/jacoco-aggregate/jacoco.xml, - ../cps-ncmp-service/target/site/jacoco-ut/jacoco.xml, - ../cps-ncmp-service/target/site/jacoco-aggregate/jacoco.xml, - ../cps-ncmp-rest/target/site/jacoco-ut/jacoco.xml, - ../cps-ncmp-rest/target/site/jacoco-aggregate/jacoco.xml, - ../cps-path-parser/target/site/jacoco-ut/jacoco.xml, - ../cps-path-parser/target/site/jacoco-aggregate/jacoco.xml, - ../cps-application/target/site/jacoco-ut/jacoco.xml, - ../cps-application/target/site/jacoco-aggregate/jacoco.xml + ../jacoco-report/target/site/jacoco-aggregate/jacoco.xml @@ -346,10 +333,10 @@ jacoco-maven-plugin + org/onap/cps/event/model/* org/onap/cps/rest/model/* org/onap/cps/cpspath/parser/antlr4/* org/onap/cps/ncmp/rest/model/* - org/onap/cps/ncmp/api/models/* @@ -380,18 +367,6 @@ - - report - - report-aggregate - - verify - - - **/code-coverage/jacoco-ut.exec - - - diff --git a/cps-service/pom.xml b/cps-service/pom.xml index c8daccca4d..0e0831558d 100644 --- a/cps-service/pom.xml +++ b/cps-service/pom.xml @@ -34,6 +34,10 @@ cps-service + + 0.94 + + org.onap.cps diff --git a/jacoco-report/pom.xml b/jacoco-report/pom.xml new file mode 100644 index 0000000000..2c2a4db97b --- /dev/null +++ b/jacoco-report/pom.xml @@ -0,0 +1,94 @@ + + + + cps-aggregator + org.onap.cps + 2.0.1-SNAPSHOT + + 4.0.0 + + jacoco-report + + + + ${project.groupId} + cps-application + ${project.version} + + + ${project.groupId} + cps-events + ${project.version} + + + ${project.groupId} + cps-ncmp-rest + ${project.version} + + + ${project.groupId} + cps-ncmp-service + ${project.version} + + + ${project.groupId} + cps-path-parser + ${project.version} + + + ${project.groupId} + cps-rest + ${project.version} + + + ${project.groupId} + cps-ri + ${project.version} + + + ${project.groupId} + cps-service + ${project.version} + + + + + + + org.jacoco + jacoco-maven-plugin + + + org/onap/cps/event/model/* + org/onap/cps/rest/model/* + org/onap/cps/cpspath/parser/antlr4/* + org/onap/cps/ncmp/rest/model/* + + + + + default-prepare-agent + + prepare-agent + + + + report + + report-aggregate + + verify + + + **/code-coverage/jacoco-ut.exec + + + + + + + + + diff --git a/pom.xml b/pom.xml index 007032dd46..573aa4294e 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,7 @@ checkstyle spotbugs cps-application + jacoco-report -- cgit 1.2.3-korg