Repository navigation
CI Visibility Gradle instrumentation - #4894
Merged
nikita-tkachenko-datadog merged 36 commits intoMar 28, 2023
Merged
nikita-tkachenko-datadog merged 36 commits into
nikita-tkachenko-datadog merged 36 commits into
Conversation
…k & test command calculation in Gradle build listener
… handled in different threads
…operty to disable build tracking
… only in the project, but also in the included builds
nikita-tkachenko-datadog
force-pushed
the
nikita-tkachenko/gradle-test-events-instrumentation
branch
from
March 14, 2023 10:33
cfc8aab to
59700d4
Compare
…s stubbing of that particular class does not work on Java 9+
…rnal-api, since corresponding classes were moved
devinsba
reviewed
Mar 14, 2023
| Project rootProject = gradle.getRootProject(); | ||
| Collection<GradleUtils.TestFramework> testFrameworks = | ||
| GradleUtils.collectTestFrameworks(rootProject); | ||
| if (testFrameworks.size() == 1) { |
Contributor
There was a problem hiding this comment.
Might be good to report back when customers do have multiples, either with a debug log so we can get it in troubleshooting, or a telemetry log message
Contributor
Author
There was a problem hiding this comment.
Agree, added a log message
nikita-tkachenko-datadog
marked this pull request as ready for review
March 21, 2023 11:37
…henko/gradle-test-events-instrumentation
devinsba
approved these changes
Mar 27, 2023
nikita-tkachenko-datadog
deleted the
nikita-tkachenko/gradle-test-events-instrumentation
branch
March 28, 2023 12:11
ValentinZakharov
pushed a commit
that referenced
this pull request
Mar 28, 2023
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
Adds a new instrumentation for Gradle Daemon processes.
The instrumentation creates spans for entire build and for each Test task within a build.
The instrumentation passes IDs of created spans to forked test processes (so that the spans created in those processes could refer to the spans from the parent daemon process).
Motivation
This is needed in order to support Test Session and Test Module levels visibility (a CI Visibility feature) for Gradle builds.
"Test session" is a CI Visibility term that is equivalent to tests run for a single project, "Test module" is equivalent to tests run for a single module within a project.
Additional Notes
Gradle Daemon is supposed to be a long-lived process potentially reused for multiple builds.
Since multiple builds for different projects can be executed by the same daemon, repository root cannot be calculated during the agent's init phase and stored in a static field anymore.
Instead it is now a part of
TestDecoratorstate (the decorator lifetime can now vary depending on whether it is used with a Gradle build or a forked test process run).Some CI Visibility classes had to be moved from
dd-java-agent/agent-ci-visibilitymodule tointernal-apimodule in order to accommodate this change.