-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Test with JDK 9 Early Access builds #296
Comments
To be honest, I've only been putting off testing on Java 9 because Gradle does not support Java 9 yet. In other words, we have no way to compile JUnit 5 against Java 9 at the moment. However, it would be possible to execute some manual smoke tests -- for example, using the |
We could try using a nightly build of Gradle, as discussed in the Gradle forum, right? |
Wow... you found that old thread of mine in the Gradle forum. That was for Gradle 2.5 and old early access releases of Java 9. Since then, many things have changed internally within Java 9, and consequently Gradle cannot even compile a The Gradle and JDK9 Status Today provides further details. Long story, short: AFAIK there is no nightly Gradle build that can compile Java code using JDK 9. But... if you discover something to the contrary, please let me know! 😉 p.s. I'll add a link to that Gradle wiki page to this issue's description. |
@sbrannen It looks like after tonight, the nightly build will have initial Java 9 support. See gradle/gradle@d482d32#diff-0a54cd20978cc67e059eefd51fb97176 for the release notes update. I would imagine it will be reflected in tonight's nightly build (should be visible at the nightly-release-notes) |
Good to know that Gradle 3.0 nightly builds are starting to support Java 9. We'll keep an eye on it. Thanks for sharing! 👍 |
Update: I just added a Deliverable for this issue. |
✅ Gradle 3.0 + JDK 8 --> works. ❌ Gradle 3.0 + JDK 9 --> fails as follows.
|
FYI: I've introduced a new Manual Test Results section to this issue's description and overhauled the Overview and Resources sections. |
How would we setup a build for this? Is there a command-line parameter to override the distributionUrl? How would we retrieve the latest one? |
I assume we can do that here: https://adopt-openjdk.ci.cloudbees.com/
Yes, the following works for me locally.
I don't know if it's possible to automatically get the latest Gradle 3.0 nightly build URL. We'll have to investigate that. At the moment that is perhaps not so important since our test code doesn't compile against JDK 9. In other words, I think we need to find A working combination before we start trying every combination of two moving targets. 😉 Of course, as previously mentioned, we could set up a separate build on Gradle 3.0 and JDK 9 that only consumes the JUnit 5 artifacts and runs some smoke tests. In other words, we don't necessarily have to compile JUnit 5 with JDK 9; simply testing JDK 8 compiled JUnit 5 artifacts on JDK 9 would be a good start. |
I have some great news! If we don't run the
So the good news is that all JUnit 5 artifacts compile against JDK 9, and all tests for the User Guide (i.e., from the |
Although ExecutionEventConditions is not technically broken, since it compiles fine on JDK 1.8, this commit refactors a single invocation of org.assertj.core.api.Assertions.allOf() so that JUnit 5 can be compiled with OpenJDK 9 early access builds. Issue: #296
Update In e6fead4, I refactored Consequently, it is now possible to run the entire JUnit 5 build (including all tests) using JDK 9! |
Nice, @sbrannen! I still consider this a bug in JDK 9, though. Did you open a ticket over at OpenJDK? |
Yes.... I in fact literally just submitted a bug which is waiting for approval. I will post back here if it gets approved. I also found a related bug report that appears to also be based on the use of |
For anyone interested, the following is the code I submitted for the aforementioned bug in JDK 9. public class Test {
public class Condition<T> {}
@SafeVarargs
public static <T> Condition<T> allOf(Condition<? super T>... conditions) {
return null;
}
public static <T> Condition<T> allOf(Iterable<? extends Condition<? super T>> conditions) {
return null;
}
@SafeVarargs
public static Condition<Number> compose(Condition<? super Number>... conditions) {
// Compiles on JDK 8 and JDK 9
Test.<Number> allOf(conditions);
// Compiles on JDK 8 but *fails* on JDK 9
allOf(conditions);
return null;
}
} |
Thanks, @sbrannen! 👍 |
Update My bug report has been accepted. The reviewer commented that the current behavior may not be legitimate, but they are looking into it in any case. |
Update: build passes with Gradle 3.0-20160627000036+0000 and JDK 9-ea+124 |
FYI: there is preliminary support for JDK 9 on Travis CI. Details here: travis-ci/travis-ci#5520 I've updated the description of this issue accordingly. |
UPDATE Our first Travis CI build using JDK 9 EA and Gradle 3.0 nightly builds just passed! https://travis-ci.org/junit-team/junit5/jobs/141875942 So, now that this is in place, I am closing this issue. However, we will still need to manually upgrade the Gradle 3.0 nightly build URL unless somebody provides a solution for automatically detecting the latest Gradle 3.0 nightly build. |
Very interesting and useful work! I appreciate this and will reuse your |
Overview
The OpenJDK team has asked the JUnit team to test with JDK 9 Early Access builds and report any showstopper issues to them.
The goal of this issue is therefore to perform such tests and provide feedback to them.
Resources
Deliverables
Manual Test Results
The following are the results of manual JUnit 5 builds against Gradle 3.0 nightly builds with JDK 8 and JDK 9.
Note:
gct
is an alias forgradlew clean test
.July 2, 2016
gct
with Gradle 3.0-20160702000020+0000 and JDK 1.8.0_92-b14gct
with 3.0-20160702000020+0000 and JDK 9-ea+124June 27, 2016
gct
with Gradle 3.0-20160627000036+0000 and JDK 1.8.0_92-b14gct
with Gradle 3.0-20160627000036+0000 and JDK 9-ea+124June 15, 2016
gct
with Gradle 3.0-20160615000025+0000 and JDK 1.8.0_92-b14gct
with Gradle 3.0-20160615000025+0000 and JDK 9-ea+122The text was updated successfully, but these errors were encountered: