KAFKA-16806: Explicitly declare JUnit dependencies for all test modules
The automatic loading of test framework implementation dependencies has been deprecated and is scheduled for removal in Gradle 9.0, so we need to declare the desired test framework directly on the test suite or explicitly declare the test framework implementation dependencies on the test's runtime classpath.
Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
Since we have remove all dependencies of JUnit 4, i think the PR is ready for review.
Hi @chia7712
I have specify the version of junit-platform-launcher, PTAL
Hi @chia7712
I have unify the version reference of junitPlatform related dependencies, PTAL
@gharris1727 which solution you prefer to apply to kafka? We have introduced junit platform-related deps to kafka ( for suite test in streams). Hence, declaring dependencies is better to me since they can be under the same version control.
@chia7712 I don't understand the question. What is the alternative to this PR? Does this solve the build warning?
What is the alternative to this PR?
another solution recommended by gradle is using jvm-test-suite. for example:
testing {
suites {
test {
useJUnitJupiter()
}
}
}
However, it is incubating so I prefer to declare the junit platform explicitly.
Does this solve the build warning?
yep. see following console output
before
> Task :connect:mirror-client:test
The automatic loading of test framework implementation dependencies has been deprecated. This is scheduled to be removed in Gradle 9.0. Declare the desired test framework directly on the test suite or explicitly declare the test framework implementation dependencies on the test's runtime classpath. Consult the upgrading guide for further information: https://docs.gradle.org/8.8/userguide/upgrading_version_8.html#test_framework_implementation_dependencies
after
> Task :connect:mirror-client:test
Gradle Test Run :connect:mirror-client:test > Gradle Test Executor 146 > SourceAndTargetTest > testEquals() PASSED
Thanks @frankvicky for the fix!