Fix code coverage reporting
- Fixed (partly duplicated) exclusion list: all exlusings now in PARENT pom only
(this means module reports and aggregate report use same exclusion
- Set common minimum to 100% (3 modules now achieve this :-) )
- Added./clean cm-parsre test to get too 10% in that module too
- Increased module specif minima to actual coverge today
Issue-ID: CPS-475
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Change-Id: Ic155f963bfd472e11481fcab6ee8ca227903d9ae
diff --git a/cps-application/pom.xml b/cps-application/pom.xml
index b9754c1..c4b3fe6 100755
--- a/cps-application/pom.xml
+++ b/cps-application/pom.xml
@@ -37,7 +37,7 @@
<properties>
<app>org.onap.cps.Application</app>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
- <minimum-coverage>0.82</minimum-coverage>
+ <minimum-coverage>0.86</minimum-coverage>
<base.image>${docker.pull.registry}/onap/integration-java17:12.0.0</base.image>
<image.tag>${project.version}-${maven.build.timestamp}</image.tag>
</properties>
diff --git a/cps-ncmp-service/pom.xml b/cps-ncmp-service/pom.xml
index 5418c7a..2aa1410 100644
--- a/cps-ncmp-service/pom.xml
+++ b/cps-ncmp-service/pom.xml
@@ -34,7 +34,7 @@
<artifactId>cps-ncmp-service</artifactId>
<properties>
- <minimum-coverage>0.96</minimum-coverage>
+ <minimum-coverage>0.98</minimum-coverage>
</properties>
<dependencies>
<dependency>
diff --git a/cps-parent/pom.xml b/cps-parent/pom.xml
index 3860a30..470c3a0 100755
--- a/cps-parent/pom.xml
+++ b/cps-parent/pom.xml
@@ -38,7 +38,7 @@
<properties>
<app>org.onap.cps.Application</app>
<java.version>17</java.version>
- <minimum-coverage>0.97</minimum-coverage>
+ <minimum-coverage>1.00</minimum-coverage>
<postgres.version>42.5.1</postgres.version>
<jacoco.reportDirectory.aggregate>${project.reporting.outputDirectory}/jacoco-aggregate</jacoco.reportDirectory.aggregate>
@@ -359,11 +359,14 @@
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<configuration>
+ <!--All exclusions below are referring to generated code-->
<excludes>
<exclude>org/onap/cps/event/model/*</exclude>
<exclude>org/onap/cps/rest/model/*</exclude>
<exclude>org/onap/cps/cpspath/parser/antlr4/*</exclude>
<exclude>org/onap/cps/ncmp/rest/model/*</exclude>
+ <exclude>org/onap/cps/**/*MapperImpl.class</exclude>
+ <exclude>org/onap/cps/ncmp/rest/stub/*</exclude>
</excludes>
</configuration>
<executions>
diff --git a/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy b/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy
index 0017242..ae7ee59 100644
--- a/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy
+++ b/cps-path-parser/src/test/groovy/org/onap/cps/cpspath/parser/CpsPathQuerySpec.groovy
@@ -28,6 +28,18 @@
class CpsPathQuerySpec extends Specification {
+ def 'Default values for the most basic cps query.'() {
+ when: 'the cps path is parsed'
+ def result = CpsPathQuery.createFrom('/parent')
+ then: 'the query has the correct default properties'
+ assert result.cpsPathPrefixType == ABSOLUTE
+ assert result.hasAncestorAxis() == false
+ assert result.hasLeafConditions() == false
+ assert result.hasTextFunctionCondition() == false
+ assert result.hasContainsFunctionCondition() == false
+ assert result.isPathToListElement() == false
+ }
+
def 'Parse cps path with valid cps path and a filter with #scenario.'() {
when: 'the given cps path is parsed'
def result = CpsPathQuery.createFrom(cpsPath)
@@ -131,13 +143,13 @@
when: 'the given cps path is parsed'
def result = CpsPathQuery.createFrom(cpsPath)
then: 'the query has the right xpath type'
- result.cpsPathPrefixType == DESCENDANT
+ assert result.cpsPathPrefixType == DESCENDANT
and: 'leaf conditions are only present when expected'
- result.hasLeafConditions() == expectLeafConditions
+ assert result.hasLeafConditions() == expectLeafConditions
and: 'the right text function condition is set'
- result.hasTextFunctionCondition()
- result.textFunctionConditionLeafName == 'leaf-name'
- result.textFunctionConditionValue == 'search'
+ assert result.hasTextFunctionCondition()
+ assert result.textFunctionConditionLeafName == 'leaf-name'
+ assert result.textFunctionConditionValue == 'search'
and: 'the ancestor is only present when expected'
assert result.hasAncestorAxis() == expectHasAncestorAxis
where: 'the following data is used'
@@ -152,11 +164,11 @@
when: 'the given cps path is parsed'
def result = CpsPathQuery.createFrom('//someContainer[contains(@lang,"en")]')
then: 'the query has the right xpath type'
- result.cpsPathPrefixType == DESCENDANT
+ assert result.cpsPathPrefixType == DESCENDANT
and: 'the right contains function condition is set'
- result.hasContainsFunctionCondition()
- result.containsFunctionConditionLeafName == 'lang'
- result.containsFunctionConditionValue == 'en'
+ assert result.hasContainsFunctionCondition()
+ assert result.containsFunctionConditionLeafName == 'lang'
+ assert result.containsFunctionConditionValue == 'en'
}
def 'Parse cps path with error: #scenario.'() {
@@ -188,7 +200,7 @@
and: 'the correct ancestor schema node identifier is set'
result.ancestorSchemaNodeIdentifier == ancestorPath
and: 'there are no leaves conditions'
- result.hasLeafConditions() == false
+ assert result.hasLeafConditions() == false
where:
scenario | ancestorPath
'basic container' | 'someContainer'
@@ -202,14 +214,14 @@
when: 'the given cps path is parsed'
def result = CpsPathQuery.createFrom(cpsPath + '/ancestor::someAncestor')
then: 'the query has the right type'
- result.cpsPathPrefixType == DESCENDANT
+ assert result.cpsPathPrefixType == DESCENDANT
and: 'leaf conditions are only present when expected'
- result.hasLeafConditions() == expectLeafConditions
+ assert result.hasLeafConditions() == expectLeafConditions
and: 'the result has ancestor axis'
- result.hasAncestorAxis()
+ assert result.hasAncestorAxis()
and: 'the correct ancestor schema node identifier is set'
- result.ancestorSchemaNodeIdentifier == 'someAncestor'
- result.descendantName == expectedDescendantName
+ assert result.ancestorSchemaNodeIdentifier == 'someAncestor'
+ assert result.descendantName == expectedDescendantName
where:
scenario | cpsPath || expectedDescendantName | expectLeafConditions
'basic container' | '//someContainer' || 'someContainer' | false
diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml
index de4aa84..6207393 100644
--- a/cps-ri/pom.xml
+++ b/cps-ri/pom.xml
@@ -33,7 +33,7 @@
<artifactId>cps-ri</artifactId>
<properties>
- <minimum-coverage>0.29</minimum-coverage>
+ <minimum-coverage>0.30</minimum-coverage>
<!-- Additional coverage is provided by integration-test module -->
</properties>
diff --git a/cps-service/pom.xml b/cps-service/pom.xml
index e38d219..c97623f 100644
--- a/cps-service/pom.xml
+++ b/cps-service/pom.xml
@@ -36,7 +36,7 @@
<artifactId>cps-service</artifactId>
<properties>
- <minimum-coverage>0.94</minimum-coverage>
+ <minimum-coverage>0.95</minimum-coverage>
</properties>
<dependencies>
diff --git a/jacoco-report/pom.xml b/jacoco-report/pom.xml
index 1ac65e2..9dbd896 100644
--- a/jacoco-report/pom.xml
+++ b/jacoco-report/pom.xml
@@ -65,25 +65,8 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
- <configuration>
- <!--All exclusions below are referring to generated code-->
- <excludes>
- <exclude>org/onap/cps/event/model/*</exclude>
- <exclude>org/onap/cps/rest/model/*</exclude>
- <exclude>org/onap/cps/cpspath/parser/antlr4/*</exclude>
- <exclude>org/onap/cps/ncmp/rest/model/*</exclude>
- <exclude>org/onap/cps/**/*MapperImpl.class</exclude>
- <exclude>org/onap/cps/ncmp/rest/stub/*</exclude>
- </excludes>
- </configuration>
<executions>
<execution>
- <id>default-prepare-agent</id>
- <goals>
- <goal>prepare-agent</goal>
- </goals>
- </execution>
- <execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>