Skip to content

Commit 28d2788

Browse files
committed
Aggregate coverage using Jacoco
Before, e.g. Parser.Builder.extensions wasn't shown as being covered at all, probably because the integration tests that use it are in a different module. By letting Jacoco aggregate the results and then have Coveralls submit that, the coverage seems to be correct now.
1 parent 400dc62 commit 28d2788

2 files changed

Lines changed: 31 additions & 7 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ script:
2020
- 'if [[ $TEST = android ]]; then mvn install -DskipTests && cd commonmark-android-test && travis_retry ./.travis.sh; fi'
2121
deploy:
2222
provider: script
23-
script: mvn clean test jacoco:report coveralls:report -Pcoverage
23+
script: mvn clean test coveralls:report -Pcoverage
2424
on:
2525
jdk: oraclejdk8
2626
condition: "$TEST = java"

commonmark-integration-test/pom.xml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45
<parent>
56
<groupId>com.atlassian.commonmark</groupId>
@@ -15,28 +16,24 @@
1516
<dependency>
1617
<groupId>com.atlassian.commonmark</groupId>
1718
<artifactId>commonmark</artifactId>
18-
<scope>test</scope>
1919
</dependency>
2020
<dependency>
2121
<groupId>com.atlassian.commonmark</groupId>
2222
<artifactId>commonmark-ext-autolink</artifactId>
23-
<scope>test</scope>
2423
</dependency>
2524
<dependency>
2625
<groupId>com.atlassian.commonmark</groupId>
2726
<artifactId>commonmark-ext-gfm-strikethrough</artifactId>
28-
<scope>test</scope>
2927
</dependency>
3028
<dependency>
3129
<groupId>com.atlassian.commonmark</groupId>
3230
<artifactId>commonmark-ext-gfm-tables</artifactId>
33-
<scope>test</scope>
3431
</dependency>
3532
<dependency>
3633
<groupId>com.atlassian.commonmark</groupId>
3734
<artifactId>commonmark-ext-yaml-front-matter</artifactId>
38-
<scope>test</scope>
3935
</dependency>
36+
4037
<dependency>
4138
<groupId>org.pegdown</groupId>
4239
<artifactId>pegdown</artifactId>
@@ -61,6 +58,33 @@
6158
</dependency>
6259
</dependencies>
6360

61+
<profiles>
62+
<profile>
63+
<id>coverage</id>
64+
<build>
65+
<plugins>
66+
<plugin>
67+
<groupId>org.jacoco</groupId>
68+
<artifactId>jacoco-maven-plugin</artifactId>
69+
<configuration>
70+
<!-- This is where coveralls expects the files to be, so just put it there. -->
71+
<outputDirectory>${project.parent.reporting.outputDirectory}/jacoco</outputDirectory>
72+
</configuration>
73+
<executions>
74+
<execution>
75+
<id>report-aggregate</id>
76+
<goals>
77+
<goal>report-aggregate</goal>
78+
</goals>
79+
<phase>test</phase>
80+
</execution>
81+
</executions>
82+
</plugin>
83+
</plugins>
84+
</build>
85+
</profile>
86+
</profiles>
87+
6488
<build>
6589
<plugins>
6690
<plugin>

0 commit comments

Comments
 (0)