Skip to content

Commit

Permalink
Add support for cross jdk version testing
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentgo committed May 3, 2024
1 parent 0143673 commit 57981d7
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 92 deletions.
26 changes: 3 additions & 23 deletions java/flight/flight-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

<properties>
<forkCount>1</forkCount>
<!-- List of add-opens arg line arguments if tests are running on JDK 11 or higher -->
<surefire.add-opens.argLine>--add-opens=org.apache.arrow.flight.core/org.apache.arrow.flight.perf.impl=protobuf.java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</surefire.add-opens.argLine>
</properties>

<dependencies>
Expand Down Expand Up @@ -136,6 +138,7 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -289,27 +292,4 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jdk11+</id>
<activation>
<jdk>[11,]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine combine.self="override">--add-opens=org.apache.arrow.flight.core/org.apache.arrow.flight.perf.impl=protobuf.java --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
<systemPropertyVariables>
<arrow.test.dataRoot>${project.basedir}/../../../testing/data</arrow.test.dataRoot>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
1 change: 1 addition & 0 deletions java/flight/flight-sql-jdbc-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>default-it</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
Expand Down
22 changes: 2 additions & 20 deletions java/flight/flight-sql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

<properties>
<forkCount>1</forkCount>
<!-- List of add-opens arg line arguments if tests are running on JDK 11 or higher -->
<surefire.add-opens.argLine>--add-reads=org.apache.arrow.flight.sql=org.slf4j --add-reads=org.apache.arrow.flight.core=ALL-UNNAMED --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</surefire.add-opens.argLine>
</properties>

<dependencies>
Expand Down Expand Up @@ -112,24 +114,4 @@
<optional>true</optional>
</dependency>
</dependencies>

<profiles>
<profile>
<id>jdk11+</id>
<activation>
<jdk>[11,]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.self="override">
<argLine>--add-reads=org.apache.arrow.flight.sql=org.slf4j --add-reads=org.apache.arrow.flight.core=ALL-UNNAMED --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
13 changes: 0 additions & 13 deletions java/flight/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,4 @@
<module>flight-sql-jdbc-driver</module>
<module>flight-integration-tests</module>
</modules>

<profiles>
<profile>
<id>pin-mockito-jdk8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<mockito.core.version>4.11.0</mockito.core.version>
<mockito.inline.version>5.2.0</mockito.inline.version>
</properties>
</profile>
</profiles>
</project>
8 changes: 6 additions & 2 deletions java/memory/memory-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
<name>Arrow Memory - Core</name>
<description>Core off-heap memory management libraries for Arrow ValueVectors.</description>

<properties>
<!-- List of add-opens arg line arguments if tests are running on JDK 11 or higher -->
<surefire.add-opens.argLine>--add-reads=org.apache.arrow.memory.core=ch.qos.logback.classic --add-opens=java.base/java.lang.reflect=org.apache.arrow.memory.core --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</surefire.add-opens.argLine>
</properties>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down Expand Up @@ -67,8 +72,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration combine.self="override">
<argLine>--add-reads=org.apache.arrow.memory.core=ch.qos.logback.classic --add-opens=java.base/java.lang.reflect=org.apache.arrow.memory.core --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
<configuration>
<excludes>
<!-- Test is only useful when NOT running with add-opens -->
<exclude>**/TestOpens.java</exclude>
Expand Down
1 change: 1 addition & 0 deletions java/memory/memory-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>default-it</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
Expand Down
101 changes: 67 additions & 34 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,22 @@
<checkstyle.failOnViolation>true</checkstyle.failOnViolation>
<errorprone.javac.version>9+181-r4173-1</errorprone.javac.version>
<error_prone_core.version>2.24.0</error_prone_core.version>
<mockito.core.version>5.11.0</mockito.core.version>
<mockito.core.version>4.11.0</mockito.core.version>
<mockito.inline.version>5.2.0</mockito.inline.version>
<checker.framework.version>3.42.0</checker.framework.version>
<doclint>none</doclint>
<additionalparam>-Xdoclint:none</additionalparam>
<!-- List of add-opens arg line arguments if tests are running on JDK 11 or higher -->
<surefire.add-opens.argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</surefire.add-opens.argLine>
<!-- org.apache:apache overrides -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
<maven.plugin.tools.version>3.11.0</maven.plugin.tools.version>
<surefire.version>3.2.5</surefire.version>
<version.apache-rat-plugin>0.16.1</version.apache-rat-plugin>
<version.maven-assembly-plugin>3.7.1</version.maven-assembly-plugin>
<version.maven-compiler-plugin>3.12.1</version.maven-compiler-plugin>
<version.maven-dependency-plugin>3.6.1</version.maven-dependency-plugin>
<version.maven-gpg-plugin>3.2.0</version.maven-gpg-plugin>
<!--
Downgrade maven-jar-plugin until https://github.com/codehaus-plexus/plexus-archiver/issues/332
is addressed
-->
<version.maven-jar-plugin>3.2.2</version.maven-jar-plugin>
<version.maven-javadoc-plugin>3.6.3</version.maven-javadoc-plugin>
<version.maven-project-info-reports-plugin>3.5.0</version.maven-project-info-reports-plugin>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -968,30 +961,6 @@
</plugins>
</build>
</profile>
<profile>
<id>jdk11+</id>
<activation>
<jdk>[11,]</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>code-coverage</id>
Expand Down Expand Up @@ -1324,5 +1293,69 @@
</plugins>
</build>
</profile>

<!-- Cross java version test profiles -->
<profile>
<id>cross-jdk-testing</id>
<activation>
<property>
<name>arrow.test.jdk-version</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${arrow.test.jdk-version}</version>
</jdkToolchain>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<jdkToolchain>
<version>${arrow.test.jdk-version}</version>
</jdkToolchain>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jdk-testing-jdk11+</id>
<activation>
<jdk>[11,</jdk>
<property>
<name>arrow.test.jdk-version</name>
<value>!1.8</value>
</property>
</activation>
<properties>
<mockito.core.version>5.11.0</mockito.core.version>
<mockito.inline.version>5.2.0</mockito.inline.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.add-opens.argLine}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>${surefire.add-opens.argLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
1 change: 1 addition & 0 deletions java/vector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
</configuration>
<executions>
<execution>
<id>default-it</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
Expand Down

0 comments on commit 57981d7

Please sign in to comment.