Skip to content

Commit

Permalink
[Build] Fix jacoco-maven-plugin integration with the build (apache#14278
Browse files Browse the repository at this point in the history
)

* Fix jacoco-maven-plugin integration with the build

* Upgrade jacoco-maven-plugin version

* Use testJacocoAgentArgument as property for jacoco agent argument instead of the default "argLine"
  • Loading branch information
lhotari authored Feb 14, 2022
1 parent 6aace81 commit f03fc17
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ flexible messaging model and an intuitive client API.</description>
<testForkCount>4</testForkCount>
<testRealAWS>false</testRealAWS>
<testRetryCount>1</testRetryCount>
<testJacocoAgentArgument></testJacocoAgentArgument>
<docker.organization>apachepulsar</docker.organization>
<skipSourceReleaseAssembly>false</skipSourceReleaseAssembly>
<skipBuildDistribution>false</skipBuildDistribution>
Expand Down Expand Up @@ -249,7 +250,7 @@ flexible messaging model and an intuitive client API.</description>
<git-commit-id-plugin.version>4.0.2</git-commit-id-plugin.version>
<wagon-ssh-external.version>3.4.3</wagon-ssh-external.version>
<os-maven-plugin.version>1.4.1.Final</os-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
<spotbugs-maven-plugin.version>4.2.2</spotbugs-maven-plugin.version>
<spotbugs.version>4.2.2</spotbugs.version>
<errorprone.version>2.5.1</errorprone.version>
Expand Down Expand Up @@ -1405,7 +1406,7 @@ flexible messaging model and an intuitive client API.</description>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine> -Xmx1G -XX:+UseG1GC
<argLine>@{testJacocoAgentArgument} -Xmx1G -XX:+UseG1GC
-Dpulsar.allocator.pooled=true
-Dpulsar.allocator.leak_detection=Advanced
-Dpulsar.allocator.exit_on_oom=false
Expand Down Expand Up @@ -1914,6 +1915,9 @@ flexible messaging model and an intuitive client API.</description>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<configuration>
<propertyName>testJacocoAgentArgument</propertyName>
</configuration>
<executions>
<execution>
<id>pre-unit-test</id>
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_0_0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>@{testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/bc_2_0_1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>@{testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
4 changes: 2 additions & 2 deletions tests/bc_2_6_0/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>@{testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand All @@ -115,4 +115,4 @@
</profiles>


</project>
</project>
2 changes: 1 addition & 1 deletion tests/integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx1G -XX:MaxDirectMemorySize=1G
<argLine>@{testJacocoAgentArgument} -Xmx1G -XX:MaxDirectMemorySize=1G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/pulsar-client-admin-shade-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>@{testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/pulsar-client-all-shade-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>@{testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down
2 changes: 1 addition & 1 deletion tests/pulsar-client-shade-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx2G -XX:MaxDirectMemorySize=8G
<argLine>@{testJacocoAgentArgument} -Xmx2G -XX:MaxDirectMemorySize=8G
-Dio.netty.leakDetectionLevel=advanced
${test.additional.args}
</argLine>
Expand Down

0 comments on commit f03fc17

Please sign in to comment.