Skip to content

Restore junit4 test ordering on gradle 9.3+ - #12098

Open
daniel-mohedano wants to merge 2 commits into
masterfrom
daniel.mohedano/junit4-gradle-93-ordering-fix
Open

Restore junit4 test ordering on gradle 9.3+#12098
daniel-mohedano wants to merge 2 commits into
masterfrom
daniel.mohedano/junit4-gradle-93-ordering-fix

Conversation

@daniel-mohedano

@daniel-mohedano daniel-mohedano commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds support for the definition-based JUnit4 processor introduced in Gradle 9.3.

The new instrumentation collects ClassTestDefinition instances, 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 JUnitTestClassProcessor and AbstractJUnitTestClassProcessor with JUnitTestDefinitionProcessor and AbstractJUnitTestDefinitinoProcessor. The executor contract also changed from Action<String> to TestDefinitionConsumer<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

Jira ticket: SDTEST-3285

@daniel-mohedano daniel-mohedano added type: bug fix Bug fix comp: ci visibility Continuous Integration Visibility tag: ai generated Largely based on code generated by an AI or LLM labels Jul 29, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 69.73% (+11.92%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4a7dc8f | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.79 s 14.74 s [-0.4%; +1.1%] (no difference)
startup:insecure-bank:tracing:Agent 13.69 s 13.70 s [-1.0%; +0.8%] (no difference)
startup:petclinic:appsec:Agent 16.97 s 16.82 s [-0.2%; +2.0%] (no difference)
startup:petclinic:iast:Agent 16.95 s 17.04 s [-1.4%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 16.83 s 17.07 s [-2.7%; -0.1%] (maybe better)
startup:petclinic:sca:Agent 17.02 s 16.76 s [+0.5%; +2.5%] (maybe worse)
startup:petclinic:tracing:Agent 15.69 s 16.09 s [-6.5%; +1.6%] (no difference)

Commit: 4a7dc8f8 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@daniel-mohedano
daniel-mohedano marked this pull request as ready for review July 29, 2026 10:44
@daniel-mohedano
daniel-mohedano requested a review from a team as a code owner July 29, 2026 10:44

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadog Autotest: PASS

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.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 8aacf2e · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: ci visibility Continuous Integration Visibility tag: ai generated Largely based on code generated by an AI or LLM type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants