aboutsummaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authorLee, Tian (tl5884) <tianl@amdocs.com>2019-10-03 14:53:50 +0100
committerLee, Tian (tl5884) <tianl@amdocs.com>2019-10-03 14:53:50 +0100
commita8698f03b33966eb9f953a4281c8344ae2c3de0e (patch)
treea975658c81b43c0ffe1df065167d53b7b9b13939 /pom.xml
parent86359a2f445a19a19d8239f2e7e07480a1bc7ba3 (diff)
Enforce minimum Jacoco line coverage
Current coverage at 87%, enforced limit set to 80% Change-Id: I0f167433e21ad444ac01987a167c1964f8c88ab8 Issue-ID: AAI-2364 Signed-off-by: Lee, Tian (tl5884) <tianl@amdocs.com>
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/pom.xml b/pom.xml
index 8dc1cd1..2ecb68d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -68,6 +68,9 @@
<aai.base.image.version>1.6.0</aai.base.image.version>
<!-- This will be used for the docker images as the default format of maven build has issues -->
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
+ <!-- Code coverage enforcement -->
+ <jacoco.report.directory>${project.build.directory}/code-coverage</jacoco.report.directory>
+ <jacoco.line.coverage.limit>0.80</jacoco.line.coverage.limit>
</properties>
<distributionManagement>
@@ -421,6 +424,34 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <dataFile>${jacoco.report.directory}/jacoco-ut.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>
</plugins>
</build>
</project>