Repository navigation
CI Visibility Maven instrumentation - #4934
Merged
nikita-tkachenko-datadog merged 51 commits intoApr 6, 2023
Merged
nikita-tkachenko-datadog merged 51 commits into
nikita-tkachenko-datadog merged 51 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
…s stubbing of that particular class does not work on Java 9+
…rnal-api, since corresponding classes were moved
…henko/gradle-test-events-instrumentation
…to nikita-tkachenko/maven-test-events-instrumentation
nikita-tkachenko-datadog
marked this pull request as ready for review
March 28, 2023 14:25
nikita-tkachenko-datadog
deleted the
nikita-tkachenko/maven-test-events-instrumentation
branch
April 6, 2023 14:23
albertvaka
reviewed
Apr 6, 2023
| public static String getCommandLine(MavenSession session) { | ||
| String mavenCmdLineArgsEnvVar = System.getenv(MAVEN_CMD_LINE_ARGS_ENVIRONMENT_VAR); | ||
| if (mavenCmdLineArgsEnvVar != null) { | ||
| return "mvn" + mavenCmdLineArgsEnvVar; |
Contributor
There was a problem hiding this comment.
Should we add a space between mvn and the args or does MAVEN_CMD_LINE_ARGS_ENVIRONMENT_VAR begin with an empty space character?
Contributor
Author
There was a problem hiding this comment.
yep, the environment var begins with a whitespace, so there's no need to add one manually
| String mavenCmdLineArgsProp = | ||
| sessionSystemProperties.getProperty("env." + MAVEN_CMD_LINE_ARGS_ENVIRONMENT_VAR); | ||
| if (mavenCmdLineArgsProp != null) { | ||
| return MVN_CMD_LINE_INVOCATION + mavenCmdLineArgsProp; |
Contributor
There was a problem hiding this comment.
Small inconsistency: You use the MVN_CMD_LINE_INVOCATION constant here but there are two instances of using the string literal mvn directly.
Contributor
Author
There was a problem hiding this comment.
Good catch! I was too quick to merge this after Brian's approval, but I'll be sure to address this in an upcoming PR
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 Maven build processes.
The instrumentation creates spans for entire build and for each surefire/failsafe plugins goal 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 Maven 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.