-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Jpms test #28726
Fix Jpms test #28726
Conversation
Run Jpms Direct Java 17 PostCommit |
Example run on fork: https://github.com/Abacn/beam/actions/runs/6342390089/job/17228019422 the test runs (though failing due to gcs credential not exist in fork). On beam repo currently test jar fails to compile |
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
Run Jpms Direct Java 17 PostCommit Jenkins phrase trigger not working though |
Run Jpms Direct Java 17 PostCommit |
Run Jpms Direct Java 11 PostCommit |
Run Jpms Direct Java 11 PostCommit both Jenkins and github action (https://github.com/apache/beam/actions/runs/6345867305) passed |
Run Jpms Direct Java 17 PostCommit both Jenkins and github action (https://github.com/apache/beam/actions/runs/6345584729) passed |
if (project.hasProperty("compileAndRunTestsWithJava17")) { | ||
javaVersion = '1.17' | ||
} else { | ||
javaVersion = '1.11' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is subtle. Current Java11/Java17 test are configured differently.
-
Java11 passed
-Dorg.gradle.java.home=$JAVA_HOME_11_X64
so all projects (e.g. java core) are also compared with Java11 -
Java17 uses
compileAndRunTestsWithJava17
flag so all but this project are compiled with default JDK (Java8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future TODO: maybe just have a testJavaVersion
separate from beamJavaVersion
rather than a boolean with a giant name that sounds more complicated than it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, noted in #28120 (comment) will be done as part of Java 21 support
def java17Home = project.findProperty("java17Home") | ||
project.tasks.withType(JavaCompile) { | ||
// direct compileJava to use specified java version. | ||
project.tasks.compileJava { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes both (default JDK is Java9+) and (default JDK is Java8 and pass java11Home
or java17Home
) works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK to me if it works. Do you need setJava11Options
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not have setJava11Options
or correspondents in beamModulePlugin
setJava17Options is due to new module export rules needed in Java17 (https://blogs.oracle.com/javamagazine/post/a-peek-into-java-17-continuing-the-drive-to-encapsulate-the-java-runtime-internals), it does the same thing as the current code (removed/simplified in this PR).
Ready for review now. PTAL @damccorm @kennknowles |
I don't think I understand the current or desired test behavior here well enough to review without doing some more research, so I will defer to @kennknowles for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this does what we want. Anyhow I think I have as much confidence after this change as I had before it :-)
if (project.hasProperty("compileAndRunTestsWithJava17")) { | ||
javaVersion = '1.17' | ||
} else { | ||
javaVersion = '1.11' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future TODO: maybe just have a testJavaVersion
separate from beamJavaVersion
rather than a boolean with a giant name that sounds more complicated than it is.
def java17Home = project.findProperty("java17Home") | ||
project.tasks.withType(JavaCompile) { | ||
// direct compileJava to use specified java version. | ||
project.tasks.compileJava { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK to me if it works. Do you need setJava11Options
?
I restarted the failed job, which seems to have failed to upload the cache. Seems there may be concurrency errors in Gradle caching. Not sure if that is GHA related or just Gradle remote cache generally. |
thanks, now all tests passed (the one in checks and github action postcommits - commented above) |
* Fix Jpms test * Configure main src also compile in specified Java ver * Fix Java11 case
Fixes #28724
Two issues
remove redundant options after Fix Java 11 Example PreCommit GItHub Action #28291 - this should fix test on Jenkins
github action test use Java11 as default, as gradle setting requires it here:
beam/sdks/java/testing/jpms-tests/build.gradle
Line 24 in 170310e
Please add a meaningful description for your change here
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.