-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-42193: [Java] Update dependency to maintain JUnit 5 only #42206
Conversation
@vibhatha Is it sufficient to just remove the Also, I encountered an error after merging my Flight Module commit as below. However, the current machine was not used to migrate the Flight Module. The machine has a tricky environment, so I cannot be sure if the error is occurring for everyone. However, the CIs seem to be working well. [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.026 s <<< FAILURE! -- in org.apache.arrow.driver.jdbc.ITDriverJarValidation
[ERROR] org.apache.arrow.driver.jdbc.ITDriverJarValidation.validateShadedJar -- Time elapsed: 0.011 s <<< FAILURE!
org.opentest4j.AssertionFailedError: jar ==> expected: <Driver jar was not detected in the classpath> but was: <jar>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1156)
at org.apache.arrow.driver.jdbc.ITDriverJarValidation.getJdbcJarFile(ITDriverJarValidation.java:72)
at org.apache.arrow.driver.jdbc.ITDriverJarValidation.validateShadedJar(ITDriverJarValidation.java:84)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITDriverJarValidation.validateShadedJar:84->getJdbcJarFile:72 jar ==> expected: <Driver jar was not detected in the classpath> but was: <jar>
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0 |
I also got the same error locally when I was testing some other feature. We may need to take a look. Could you file an issue? |
Also I am not sure if that would be the only dependency. Can we try intellisense and see if we still get the Junit4? |
We can check the dependencies using There are no JUnit 4.x dependencies. So, I believe there is no need for further checks. I attached result. mvn dependency:tree | grep junit
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test
[INFO] | +- org.junit.platform:junit-platform-engine:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.10.2:test
[INFO] +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:2.25.1:test |
That's right. The issue appears intermittently. I'll summarize the details and create an issue. |
I believe we have a way to configure disallowed dependencies for a stronger check |
Ah, the root POM has maven-enforcer-plugin which can ban junit4 entirely |
I took a look, we already listed a few such dependencies. That's perfect. Let's use that. |
@@ -659,6 +646,9 @@ under the License. | |||
<!-- Do not include annotation processors. Use the annotations-only artifacts --> | |||
<exclude>org.immutables:value</exclude> | |||
<exclude>org.checkerframework:checker</exclude> | |||
<!-- Exclude all JUnit 4 dependencies --> | |||
<exclude>junit:junit:4.*</exclude> | |||
<exclude>org.junit.vintage:junit-vintage-engine</exclude> |
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 updated it. Thank you for review!
@github-actions crossbow submit -g java |
Revision: be5e51a Submitted crossbow builds: ursacomputing/crossbow @ actions-cc74f066f5 |
I created issue for comment |
just making sure java-jars passes now |
Did we re-run? |
@vibhatha can someone take a look at the issue? I don't think this will go away on re-run |
That was rebased about two hours ago. Perhaps we could try running it again? |
@github-actions crossbow submit java-jars |
Revision: f41f9b7 Submitted crossbow builds: ursacomputing/crossbow @ actions-5074156199
|
@llama90 if you want to rebase here I can re-run Crossbow |
@lidavidm Done! |
@github-actions crossbow submit -g java |
Revision: 4db3a9f Submitted crossbow builds: ursacomputing/crossbow @ actions-4efa92c4b0 |
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit f07d442. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 10 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
We have completed migrating all unit test code from JUnit 4 to JUnit 5 for all Java modules. Now, we are removing the compatibility library
junit-vintage-engine
to maintain JUnit 5 only.What changes are included in this PR?
junit.framework.TestCase
importsAre these changes tested?
Yes.
Are there any user-facing changes?
No.