-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-19500. Skip tests that require JavaScript engine when it's not available #7503
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
Conversation
|
🎊 +1 overall
This message was automatically generated. |
| import org.junit.jupiter.api.Test; | ||
| import org.junit.jupiter.api.Timeout; | ||
|
|
||
| import static org.junit.Assume.assumeNotNull; |
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.
If we find that the relevant classes already use org.junit.jupiter, we can use the JUnit 5 syntax.
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.
Thank you.
Fixed.
|
🎊 +1 overall
This message was automatically generated. |
steveloughran
left a comment
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.
some suggestions
| @Before | ||
| public void setup() { | ||
| //JavaScript engine has been removed from Java in Java 15. | ||
| assumeNotNull(new ScriptEngineManager().getEngineByName("JavaScript")); |
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 a common assert. why not pull it out into some shared utility class
- add a text message as to why it was skipped, just for those test reports
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 for the review @steveloughran .
A utility class wouldn't really work because some of the tests use JUnit 4 and others Junit 5.
I have refactored the changes, and pushed the SLS check into the superclass, so that now there are only two assume instances, and a message is set.
| import org.junit.runners.Parameterized; | ||
| import org.junit.runners.Parameterized.Parameters; | ||
|
|
||
| import static org.junit.Assume.assumeNotNull; |
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.
if you don't factor out the common assert, can you put the static import at the bottom of all other imports. thanks
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.
Sure.
Is there an Eclipse code formatter definition somewhere I can use ?
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
no eclipse style, AFAIK |
steveloughran
left a comment
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.
LGTM
+1
… available (apache#7503) Contributed by Istvan Toth
…when it's not available (apache#7503) Contributed by Istvan Toth
Description of PR
Skip tests that require JavaScript engine if it is not available in the JVM
How was this patch tested?
Ran the affected tests with JDK 17, confirmed that they are skipped instead of failing or erroring out
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?