Skip to content

Commit 9016603

Browse files
authored
Merge branch 'master' into inferred-span-tags
2 parents b004c19 + 4d01d58 commit 9016603

File tree

6 files changed

+37
-6
lines changed

6 files changed

+37
-6
lines changed

.circleci/config.continue.yml.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ commands:
167167
if [[ "$BRANCH" != "master" ]] && [[ "$BRANCH" != "release/*" ]]; then
168168
# We know that we have checked out the PR merge branch, so the HEAD commit is a merge
169169
# As a backup, if anything goes wrong with the diff, the build will fail
170-
# Get list of changed files directly using git diff-tree to avoid issues with large binary files
171-
CHANGED_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD)
170+
CHANGED_FILES=$(git show HEAD | grep -e "^Merge:" | cut -d ' ' -f 2- | sed 's/ /.../' | xargs git diff --name-only)
172171
# Count the number of matches, and ignore if the grep doesn't match anything
173172
MATCH_COUNT=$(echo "$CHANGED_FILES" | grep -c -E "<< pipeline.parameters.global_pattern >>|<< parameters.pattern >>") || true
174173
if [[ "$MATCH_COUNT" -eq "0" ]]; then

dd-java-agent/agent-tooling/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,9 @@ project.tasks.compileTest_java11Java.configure {
8989
final jmh = project.tasks.jmh
9090
jmh.outputs.upToDateWhen { false }
9191
jmh.dependsOn(compileTestJava)
92+
93+
tasks.withType(Test).configureEach {
94+
// same setting as AgentInstaller to avoid spurious agent-tooling test failures
95+
// caused by ConfigTransformSpockExtension installing byte-buddy during testing
96+
jvmArgs += ["-Dnet.bytebuddy.raw=true"]
97+
}

dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/bytebuddy/outline/TypeFactoryForkedTest.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package datadog.trace.agent.tooling.bytebuddy.outline
22

33
import datadog.trace.agent.tooling.bytebuddy.ClassFileLocators
44
import datadog.trace.agent.tooling.bytebuddy.matcher.DDElementMatchers
5+
import net.bytebuddy.description.type.TypeDescription
56
import spock.lang.Shared
67
import spock.lang.Specification
78

@@ -28,6 +29,9 @@ class TypeFactoryForkedTest extends Specification {
2829
def hasContextField = declaresContextField('java.lang.Runnable', 'java.lang.String')
2930

3031
def "can mix full types with outlines"() {
32+
expect:
33+
TypeDescription.AbstractBase.RAW_TYPES // this test relies on raw-types
34+
3135
when:
3236
def systemLoader = ClassLoader.systemClassLoader
3337
def systemLocator = ClassFileLocators.classFileLocator(systemLoader)

dd-java-agent/build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ def includeShadowJar(TaskProvider<ShadowJar> shadowJarTask, String jarname) {
9999
rename '(^.*)\\.class$', '$1.classdata'
100100
// Rename LICENSE file since it clashes with license dir on non-case sensitive FSs (i.e. Mac)
101101
rename '^LICENSE$', 'LICENSE.renamed'
102+
if (jarname == 'inst') {
103+
// byte-buddy now ships classes optimized for Java8+ under META-INF/versions/9
104+
// since we target Java8+ we can promote these classes over the pre-Java8 ones
105+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
106+
eachFile {
107+
if (it.path.contains('META-INF/versions/9/net/bytebuddy')) {
108+
it.path = it.path.replace('META-INF/versions/9/', '')
109+
}
110+
}
111+
}
102112
}
103113
}
104114

dd-java-agent/instrumentation/mule-4/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ configurations.all {
7878
// avoid bringing in logback based on java 11
7979
force libs.logback.classic
8080
force libs.logback.core
81+
82+
// force specific version of byte-buddy for all configurations
83+
force 'net.bytebuddy:byte-buddy:1.14.18'
8184
}
8285
}
8386

@@ -146,7 +149,6 @@ dependencies {
146149
testImplementation project(':dd-java-agent:instrumentation:caffeine')
147150
testImplementation project(':dd-java-agent:instrumentation:quartz-2')
148151

149-
150152
testImplementation group: 'org.mule.runtime', name: 'mule-module-launcher', version: muleVersion
151153
testImplementation group: 'org.mule.runtime', name: 'mule-core', version: muleVersion
152154
//testImplementation group: 'org.mule.runtime', name: 'mule-module-extensions-spring-support', version: muleVersion
@@ -175,7 +177,6 @@ dependencies {
175177
latestDepForkedTestImplementation group: 'org.mule.runtime', name: 'mule-module-service', version: '4.8.+'
176178
latestDepForkedTestImplementation group: 'org.mule.runtime', name: 'mule-module-javaee', version: '4.8.+'
177179

178-
179180
//TODO: 4.9.0 is not yet out but it looks like using 4.+ instead of above 4.8.+ brings in 4.9.0-SNAPSHOT artifacts.
180181
/*
181182
When testing with them, the mule container does not bootstrap because of:

dd-java-agent/instrumentation/spark/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkListenerTest.groovy

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,20 @@ abstract class AbstractSparkListenerTest extends AgentTestRunner {
475475
conf.set("spark.openlineage.rootParentJobName", "dag-push-to-s3-spark")
476476
def listener = getTestDatadogSparkListener(conf)
477477

478-
expect:
478+
when:
479479
listener.onApplicationStart(applicationStartEvent(1000L))
480-
assert listener.openLineageSparkConf.get("spark.openlineage.run.tags").contains("13959090542865903119")
480+
listener.onApplicationEnd(new SparkListenerApplicationEnd(2000L))
481+
482+
then:
483+
assertTraces(1) {
484+
trace(1) {
485+
span {
486+
operationName "spark.application"
487+
spanType "spark"
488+
assert span.context.traceId.toString() == "13959090542865903119"
489+
}
490+
}
491+
}
481492
}
482493

483494
def "test lastJobFailed is not set when job is cancelled"() {

0 commit comments

Comments
 (0)