Skip to content

Commit

Permalink
Run Error Prone tests against the configured JDK version
Browse files Browse the repository at this point in the history
The adoption of maven toolchains meant this was accidentally always running tests against the latest JDK we had a toolchain for, instead of the default JDK  version configured for the current CI run.

PiperOrigin-RevId: 664985450
  • Loading branch information
cushon authored and Error Prone Team committed Aug 19, 2024
1 parent cad8b20 commit d40144f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,19 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<jdkToolchain>
<!--
Test against the current default JDK, not the latest JDK a toolchain is registered for.
On Error Prone's CI, the JDK we want to run the tests against is installed last, to
make it the default on the PATH and for JAVA_HOME:
https://github.com/google/error-prone/blob/master/.github/workflows/ci.yml
See also Guava's similar logic here:
https://github.com/google/guava/blob/781068569f0a275ac3c4bce08c9a1fe4d624048a/pom.xml#L20
-->
<version>${java.specification.version}</version>
</jdkToolchain>
<argLine>
-Xmx1g
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
Expand Down

0 comments on commit d40144f

Please sign in to comment.