Allow forked test tasks for source sets other than test - #12147
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 1fb9331 | Docs | View more details | Give us feedback! |
b5e02c8 to
36f6dd2
Compare
🟢 Java Benchmark SLOs — All performance SLOs passed
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. |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
36f6dd2 to
1fb9331
Compare
There was a problem hiding this comment.
More details
The existing task keeps its default source set. Custom tasks use the selected source set and the same fork controls.
🤖 Datadog Autotest · Commit 1fb9331 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Build pipeline has failing jobs for bd9fd67: What to do next?
DetailsSince those jobs are not marked as being allowed to fail, the pipeline will most likely fail. |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Lets a module register a forked-test task for a source set other than
test.gradle/java_no_deps.gradleregistered a single hardcodedforkedTesttask bound tosourceSets.test. This turns that registration into a reusable helper next to its siblings ingradle/test-suites.gradle, and calls it with'test'from the same place as before:A module with its own suites now opts in with one line:
No behaviour changes for any existing module:
forkedTestis still registered for every project, with the same name and the same configuration.Motivation
Modules that do not use the default
testsource set silently do not run their forked tests.The convention plugin excludes
**/*ForkedTest*from every non-forked Test task, and the only task that runs them was bound tosourceSets.test. A module that keeps its tests in its own suites — for example to compile the same tests against several Scala versions — therefore has no task that runs its*ForkedTestclasses at all.Two modules are in exactly that state today, with forked tests that have never executed:
dd-java-agent/instrumentation/pekko/pekko-http-1.0— 6 classes insrc/baseTestdd-java-agent/instrumentation/netty/netty-3.8— 2 classes insrc/latestDepTestThis PR only provides the mechanism. Switching those modules on is deliberately left out, because their dormant tests do not currently pass — running pekko's surfaces a real NPE in
PekkoHttpClientHelpers$PekkoHttpHeadersduring Data Streams injection — and each needs its own investigation.Additional Notes
This PR only adds the helper; enabling it in existing modules will be handled separately.
Validation:
:internal-api:forkedTestpassed 6 tests, confirming the defaulttestsource-set behavior is unchanged.spotlessGroovyGradleCheckpassed.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: [PROJ-IDENT]
🤖 Generated with Claude Code