Files
iot-dc3/dc3-coverage/pom.xml
T
Vickey c47e5f0a37 test(infra): add coverage and end-to-end aggregator modules
Introduce two reactor modules that exist purely to host repository-wide
test concerns:

- dc3-coverage (packaging=pom) runs jacoco:report-aggregate against all
  contributing modules and applies a tree-wide jacoco:check rule. The
  aggregator excludes generated sources, deployable Application classes,
  POJO entity packages and the third-party modbus4j sero utilities so
  the percentage stays anchored on real business logic. Coverage gates
  start at 0% and tighten in later stages as more tests land.
- dc3-e2e (packaging=jar) reserves a place for the docker-compose driven
  end-to-end suite delivered in stage S8. Unit and integration phases
  are skipped by default and only the e2e profile turns them on.

Both modules are wired into the root reactor.
2026-05-13 13:02:26 +08:00

127 lines
5.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016-present the IoT DC3 original author or authors.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as
~ published by the Free Software Foundation, either version 3 of the
~ License, or (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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>io.github.pnoker</groupId>
<artifactId>iot-dc3</artifactId>
<version>2026.5.5</version>
</parent>
<artifactId>dc3-coverage</artifactId>
<packaging>pom</packaging>
<description>
Aggregates Jacoco coverage reports from every covered module in the
iot-dc3 reactor. This module owns no production code; it exists so
Jacoco can produce a single tree-wide HTML/XML report and apply the
repository-level coverage gates declared by the build.
</description>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<!-- Coverage thresholds gated by jacoco:check. Tightened per-stage. -->
<coverage.line.minimum>0.00</coverage.line.minimum>
<coverage.branch.minimum>0.00</coverage.branch.minimum>
</properties>
<dependencies>
<!--
Modules listed here contribute to the aggregate report. As new test
stages land, the contributing modules are added below so their
jacoco.exec / jacoco-it.exec files are picked up.
-->
<dependency>
<groupId>io.github.pnoker</groupId>
<artifactId>dc3-common-public</artifactId>
<version>${dc3.version}</version>
</dependency>
<dependency>
<groupId>io.github.pnoker</groupId>
<artifactId>dc3-common-exception</artifactId>
<version>${dc3.version}</version>
</dependency>
<dependency>
<groupId>io.github.pnoker</groupId>
<artifactId>dc3-common-constant</artifactId>
<version>${dc3.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>aggregate-report</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/site/jacoco-aggregate</outputDirectory>
<excludes>
<exclude>**/*Application.class</exclude>
<exclude>**/generated/**</exclude>
<exclude>**/proto/**</exclude>
<exclude>**/entity/bo/**</exclude>
<exclude>**/entity/vo/**</exclude>
<exclude>**/entity/model/**</exclude>
<exclude>**/entity/query/**</exclude>
<exclude>com/serotonin/modbus4j/sero/log/**</exclude>
<exclude>com/serotonin/modbus4j/sero/timer/**</exclude>
<exclude>com/serotonin/modbus4j/sero/epoll/**</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>aggregate-check</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>${coverage.line.minimum}</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>${coverage.branch.minimum}</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>