blob: 9596244bececfe0ded1b6e885a1986a5c8acdaf8 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.iotdb</groupId>
<artifactId>iotdb-parent</artifactId>
<version>0.12.6</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>iotdb-code-coverage</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>1.6.0</version>
<executions>
<execution>
<id>make-cmake-executable</id>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<basedir>${project.basedir}</basedir>
<executable>chmod</executable>
<arguments>
<argument>+x</argument>
<argument>copy-code-coverage-sources.sh</argument>
</arguments>
</configuration>
</execution>
<execution>
<phase>post-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${project.basedir}/copy-code-coverage-sources.sh</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<configuration>
<excludes>
<exclude>org/apache/iotdb/service/sync/thrift/*</exclude>
<exclude>org/apache/iotdb/service/rpc/thrift/*</exclude>
<exclude>org/apache/iotdb/cluster/rpc/thrift/*</exclude>
<exclude>org/apache/iotdb/db/qp/sql/*</exclude>
</excludes>
<rules>
<rule implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits>  
<!-- Cover methodes >=30%. (the plugin does not support
ignore getter and setter and toString etc..) -->
<limit implementation="org.jacoco.report.check.Limit">
<counter>METHOD</counter>
<value>COVEREDRATIO</value>
<minimum>0.00</minimum>
</limit>
<!-- if-else, swtich etc.. >=70% -->
<limit implementation="org.jacoco.report.check.Limit">
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.00</minimum>
</limit>
<!-- class files >=95% -->
<limit implementation="org.jacoco.report.check.Limit">
<counter>CLASS</counter>
<value>COVEREDRATIO</value>
<minimum>0.00</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
<executions>
<!-- see https://natritmeyer.com/howto/reporting-aggregated-unit-and-integration-test-coverage-with-jacoco/-->
<execution>
<id>merge-unit-and-integration-final</id>
<phase>post-integration-test</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}/</directory>
<includes>
<include>*.exec</include>
</includes>
</fileSet>
</fileSets>
<destFile>${project.build.directory}/merged.exec</destFile>
</configuration>
</execution>
<execution>
<id>create-merged-report-final</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
<goal>check</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/merged.exec</dataFile>
<outputDirectory>${project.build.directory}/jacoco-merged-reports</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>