Restore junit4 test ordering on gradle 9.3+ - #12098
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 4a7dc8f | Docs | Datadog PR Page | Give us feedback! |
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
There was a problem hiding this comment.
More details
The new Gradle 9.3 definition-based collector follows the existing fail-fast ordering flow and the smoke matrix now exercises Gradle 9.3 and latest versions. No diff-specific behavioral regression was confirmed; full compilation was blocked by unavailable network access for the wrapper and an unavailable Java 25 toolchain in the sandbox.
🤖 Datadog Autotest · Commit 8aacf2e · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
What Does This Do
Adds support for the definition-based JUnit4 processor introduced in Gradle 9.3.
The new instrumentation collects
ClassTestDefinitioninstances, orders their test classes using the existing fail-fast class orderer, and then delegates execution to Gradle in that order.The existing processor instrumentation remains in place for older Gradle versions. The ordering smoke test now covers Gradle 9.3.0 and the latest Gradle release again.
Motivation
Gradle 9.3 replaced
JUnitTestClassProcessorandAbstractJUnitTestClassProcessorwithJUnitTestDefinitionProcessorandAbstractJUnitTestDefinitinoProcessor. The executor contract also changed fromAction<String>toTestDefinitionConsumer<ClassTestDefinition>.The existing instrumentation no longer matched these intenral APIs. JUnit 4 classes therefore ran in Gradle's default order instead of the order selected by Test Optimization.
Additional Notes
test-environment-trigger: skip
Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: SDTEST-3285