Skip to content

Commit d302261

Browse files
authored
Merge pull request #213 from data-integrations/coverage
Enable code coverage report
2 parents cdeb0cf + 29c1277 commit d302261

File tree

2 files changed

+119
-2
lines changed

2 files changed

+119
-2
lines changed

coverage-report/pom.xml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright © 2022 Cask Data, Inc.
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
~ use this file except in compliance with the License. You may obtain a copy of
7+
~ the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
~ License for the specific language governing permissions and limitations under
15+
~ the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0"
18+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20+
<parent>
21+
<groupId>io.cdap.delta</groupId>
22+
<artifactId>database-delta-plugins</artifactId>
23+
<version>0.8.0-SNAPSHOT</version>
24+
</parent>
25+
<modelVersion>4.0.0</modelVersion>
26+
27+
<artifactId>coverage-report</artifactId>
28+
<name>Database Delta Code Coverage</name>
29+
30+
<dependencies>
31+
<dependency>
32+
<groupId>io.cdap.delta</groupId>
33+
<artifactId>delta-plugins-common</artifactId>
34+
<version>${project.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>io.cdap.delta</groupId>
38+
<artifactId>mysql-delta-plugins</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>io.cdap.delta</groupId>
43+
<artifactId>sqlserver-delta-plugins</artifactId>
44+
<version>${project.version}</version>
45+
</dependency>
46+
</dependencies>
47+
<profiles>
48+
<profile>
49+
<id>coverage</id>
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.jacoco</groupId>
54+
<artifactId>jacoco-maven-plugin</artifactId>
55+
<version>${jacoco.version}</version>
56+
<executions>
57+
<execution>
58+
<id>report</id>
59+
<goals>
60+
<goal>report-aggregate</goal>
61+
</goals>
62+
<phase>verify</phase>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
</plugins>
67+
</build>
68+
</profile>
69+
</profiles>
70+
</project>

pom.xml

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
<debezium.version>1.3.1.Final</debezium.version>
6464
<slf4j.version>1.7.25</slf4j.version>
6565
<guava.version>30.0-jre</guava.version>
66+
<jacoco.version>0.8.8</jacoco.version>
67+
<!-- Need default value when coverage is not collected -->
68+
<argLine />
6669
</properties>
6770

6871
<repositories>
@@ -195,6 +198,9 @@
195198
<groupId>io.fabric8</groupId>
196199
<artifactId>docker-maven-plugin</artifactId>
197200
<version>0.33.0</version>
201+
<configuration>
202+
<skip>${skipITs}</skip>
203+
</configuration>
198204
<executions>
199205
<execution>
200206
<id>start</id>
@@ -260,9 +266,9 @@
260266
<plugin>
261267
<groupId>org.apache.maven.plugins</groupId>
262268
<artifactId>maven-surefire-plugin</artifactId>
263-
<version>2.14.1</version>
269+
<version>2.17</version>
264270
<configuration>
265-
<argLine>-Xmx512m</argLine>
271+
<argLine>@{argLine} -Xmx512m</argLine>
266272
<systemPropertyVariables>
267273
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
268274
</systemPropertyVariables>
@@ -325,6 +331,7 @@
325331
<exclude>**/org/apache/hadoop/**</exclude>
326332
<!-- exclude resource files-->
327333
<exclude>**/resources/**</exclude>
334+
<exclude>coverage-report/target/**</exclude>
328335
</excludes>
329336
</configuration>
330337
</execution>
@@ -410,6 +417,46 @@
410417
</plugins>
411418
</build>
412419
</profile>
420+
<profile>
421+
<id>coverage</id>
422+
<modules>
423+
<module>coverage-report</module>
424+
</modules>
425+
<build>
426+
<plugins>
427+
<plugin>
428+
<groupId>org.apache.maven.plugins</groupId>
429+
<artifactId>maven-site-plugin</artifactId>
430+
<version>3.7.1</version>
431+
</plugin>
432+
<plugin>
433+
<groupId>org.jacoco</groupId>
434+
<artifactId>jacoco-maven-plugin</artifactId>
435+
<version>${jacoco.version}</version>
436+
<executions>
437+
<execution>
438+
<id>prepare-agent</id>
439+
<goals>
440+
<goal>prepare-agent</goal>
441+
</goals>
442+
</execution>
443+
<execution>
444+
<id>report</id>
445+
<goals>
446+
<goal>report</goal>
447+
</goals>
448+
<configuration>
449+
<formats>
450+
<format>XML</format>
451+
<format>HTML</format>
452+
</formats>
453+
</configuration>
454+
</execution>
455+
</executions>
456+
</plugin>
457+
</plugins>
458+
</build>
459+
</profile>
413460
</profiles>
414461

415462
</project>

0 commit comments

Comments
 (0)