Allow forked test tasks for source sets other than test - #12147
Open
AlexeyKuznetsov-DD wants to merge 1 commit into
Open
Allow forked test tasks for source sets other than test#12147AlexeyKuznetsov-DD wants to merge 1 commit into
AlexeyKuznetsov-DD wants to merge 1 commit into
Conversation
Contributor
|
🎯 Code Coverage (details) 🔗 Commit SHA: 1fb9331 | Docs | View more details | Give us feedback! |
AlexeyKuznetsov-DD
force-pushed
the
alexeyk/forked-test-source-set
branch
from
August 5, 2026 15:13
b5e02c8 to
36f6dd2
Compare
Contributor
🟢 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>
AlexeyKuznetsov-DD
force-pushed
the
alexeyk/forked-test-source-set
branch
from
August 26, 2026 18:46
36f6dd2 to
1fb9331
Compare
AlexeyKuznetsov-DD
marked this pull request as ready for review
August 26, 2026 19:10
Contributor
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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