test: simplifying Java 8 test via jvm property#2440
Conversation
|
Warning: This pull request is touching the following templated files:
|
| // This is dummy statement to touch the Version class that is compiled for Java 11 | ||
| System.out.println("org.graalvm.home.Version: " + org.graalvm.home.Version.parse("1.2.3")); |
There was a problem hiding this comment.
Test to confirm the Java 8 test fails with Java 8-incompatible class.
There was a problem hiding this comment.
The test successfully detected the incompatible class file in Java 8:
Error: com.google.cloud.spanner.RetryOnInvalidatedSessionTest Time elapsed: 0 s <<< ERROR!
java.lang.UnsupportedClassVersionError: org/graalvm/home/Version has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
This reverts commit 7752fa4.
|
@rajatbhatta Would you review this? |
rajatbhatta
left a comment
There was a problem hiding this comment.
LGTM, apart from one comment.
| requiresCodeOwnerReviews: true | ||
| requiresStrictStatusChecks: false | ||
| requiredStatusCheckContexts: | ||
| - dependencies (8) |
There was a problem hiding this comment.
Shall we do this for other patterns too? 4.0.x and 5.2.x.
Also, looks like the dependencies github checks are stuck. |
suztomo
left a comment
There was a problem hiding this comment.
I'll remove the dependencies checks from required checks. We only need one.
| requiredStatusCheckContexts: | ||
| - dependencies (8) | ||
| - dependencies (11) | ||
| - dependencies (17) |
There was a problem hiding this comment.
Background: we don't need to repeatedly check the dependencies via different JDKs.
| # For Java 8 tests, use JDK 11 to compile | ||
| - if: ${{matrix.java}} == '8' | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: 11 | ||
| distribution: zulu | ||
| - if: ${{matrix.java}} == '8' | ||
| run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV | ||
| shell: bash |
There was a problem hiding this comment.
This removal is the simplification
| - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV | ||
| shell: bash |
There was a problem hiding this comment.
This removal is the simplification
| requiresCodeOwnerReviews: true | ||
| requiresStrictStatusChecks: false | ||
| requiredStatusCheckContexts: | ||
| - dependencies (8) |
I found we can simplify the Java 8 test via surefire's jvm property (document: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm)
Changing the required checks to use "dependencies (17)" only. There's no point running the dependencies checks for different JDK versions.
Once approved, I will change the required checks in repository settings to merge this pull request.