set jacoco coverage limit 66/84366/1
authorrenealr <reneal.rogers@amdocs.com>
Fri, 5 Apr 2019 16:33:28 +0000 (12:33 -0400)
committerrenealr <reneal.rogers@amdocs.com>
Fri, 5 Apr 2019 16:36:36 +0000 (12:36 -0400)
Issue-ID: AAI-2320

Change-Id: I13ff44d0719c2941417b16d9a49cf5bf2b63442b
Signed-off-by: renealr <reneal.rogers@amdocs.com>
sparkybe-onap-service/pom.xml

index d558246..9586c75 100644 (file)
@@ -27,6 +27,7 @@
                <version.aai-schema>1.3.0</version.aai-schema>
                <sitePath>/content/sites/site/org/onap/aai/sparky-be/${project.artifactId}/${project.version}</sitePath>
                <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+               <jacoco.line.coverage.limit>0.56</jacoco.line.coverage.limit>
        </properties>
 
 
@@ -483,6 +484,11 @@ some of the depedencies should probably have a scope of provided so they don't a
                                                <goals>
                                                        <goal>prepare-agent</goal>
                                                </goals>
+                                               <configuration>
+                                                       <destFile>${project.build.directory}/coverage-reports/jacoco.exec
+                                                       </destFile>
+                            <!-- <append>true</append> -->
+                                               </configuration>
                                        </execution>
                                        <execution>
                                                <id>report</id>
@@ -491,6 +497,28 @@ some of the depedencies should probably have a scope of provided so they don't a
                                                        <goal>report</goal>
                                                </goals>
                                        </execution>
+                                       <execution>
+                        <id>default-check</id>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <configuration>
+                            <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
+                            <rules>
+                                <!--  implementation is needed only for Maven 2  -->
+                                <rule implementation="org.jacoco.maven.RuleConfiguration">
+                                    <element>BUNDLE</element>
+                                    <limits>
+                                        <limit implementation="org.jacoco.report.check.Limit">
+                                            <counter>LINE</counter>
+                                            <value>COVEREDRATIO</value>
+                                            <minimum>${jacoco.line.coverage.limit}</minimum>
+                                        </limit>
+                                    </limits>
+                                </rule>
+                            </rules>
+                        </configuration>
+                    </execution>
                                </executions>
                        </plugin>