Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import com.diffplug.gradle.spotless.SpotlessExtension
import datadog.gradle.plugin.ci.testAggregate

plugins {
kotlin("jvm") version libs.versions.kotlin.plugin apply false

id("dd-trace-java.gradle-debug")
id("dd-trace-java.dependency-locking")
id("dd-trace-java.tracer-version")
Expand All @@ -16,7 +18,6 @@ plugins {
id("com.gradleup.shadow") version "8.3.6" apply false
id("me.champeau.jmh") version "0.7.3" apply false
id("org.gradle.playframework") version "0.13" apply false
kotlin("jvm") version libs.versions.kotlin.plugin apply false
}

description = "dd-trace-java"
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gradlePlugin {
id = "dd-trace-java.instrument"
implementationClass = "InstrumentPlugin"
}

create("muzzle-plugin") {
id = "dd-trace-java.muzzle"
implementationClass = "datadog.gradle.plugin.muzzle.MuzzlePlugin"
Expand All @@ -26,18 +27,22 @@ gradlePlugin {
id = "dd-trace-java.call-site-instrumentation"
implementationClass = "datadog.gradle.plugin.csi.CallSiteInstrumentationPlugin"
}

create("tracer-version-plugin") {
id = "dd-trace-java.tracer-version"
implementationClass = "datadog.gradle.plugin.version.TracerVersionPlugin"
}

create("dump-hanged-test-plugin") {
id = "dd-trace-java.dump-hanged-test"
implementationClass = "datadog.gradle.plugin.dump.DumpHangedTestPlugin"
}

create("supported-config-generation") {
id = "dd-trace-java.supported-config-generator"
implementationClass = "datadog.gradle.plugin.config.SupportedConfigPlugin"
}

create("supported-config-linter") {
id = "dd-trace-java.config-inversion-linter"
implementationClass = "datadog.gradle.plugin.config.ConfigInversionLinter"
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/call-site-instrumentation-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ dependencies {
implementation("org.freemarker", "freemarker", "2.3.30")
implementation(libs.asm)
implementation(libs.asm.tree)
implementation("com.github.javaparser", "javaparser-symbol-solver-core", "3.24.4")
implementation(libs.javaparser.symbol.solver)

testImplementation(libs.bytebuddy)
testImplementation(libs.groovy)
testImplementation(libs.bundles.groovy)
testImplementation(libs.bundles.spock)
testImplementation("javax.servlet", "javax.servlet-api", "3.0.1")
testImplementation("com.github.spotbugs", "spotbugs-annotations", "4.2.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ apply from: "$rootDir/gradle/version.gradle"
dependencies {
api project(':dd-java-agent:instrumentation-testing')
api project(':dd-java-agent:agent-ci-visibility:civisibility-test-fixtures')

compileOnly(libs.bundles.groovy)
compileOnly(libs.bundles.spock)
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ dependencies {
api libs.jackson.databind
api group: 'org.msgpack', name: 'jackson-dataformat-msgpack', version: '0.9.6'
api group: 'org.xmlunit', name: 'xmlunit-core', version: '2.10.3'

compileOnly(libs.junit.jupiter)
compileOnly(libs.bundles.groovy)
compileOnly(libs.bundles.spock)
}

7 changes: 4 additions & 3 deletions dd-java-agent/agent-iast/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ dependencies {

testImplementation project(':utils:test-utils')
testImplementation project(':dd-java-agent:agent-bootstrap')
testImplementation libs.bytebuddy
testImplementation('org.skyscreamer:jsonassert:1.5.1')
testImplementation libs.groovy.yaml
testImplementation libs.guava
testImplementation(libs.bytebuddy)
testImplementation(libs.guava)

testImplementation(libs.groovy.yaml)

testImplementation group: 'io.grpc', name: 'grpc-core', version: grpcVersion
testImplementation group: 'io.grpc', name: 'grpc-protobuf', version: grpcVersion
Expand Down
3 changes: 3 additions & 0 deletions dd-java-agent/agent-iast/iast-test-fixtures/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ apply from: "$rootDir/gradle/version.gradle"
dependencies {
api project(':dd-java-agent:agent-iast')
api project(':dd-java-agent:instrumentation-testing')

compileOnly(libs.bundles.groovy)
compileOnly(libs.bundles.spock)
}
5 changes: 5 additions & 0 deletions dd-java-agent/appsec/appsec-test-fixtures/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ apply from: "$rootDir/gradle/version.gradle"
dependencies {
api project(':dd-java-agent:appsec')
api project(':dd-java-agent:instrumentation-testing')

compileOnly(libs.junit.jupiter)

compileOnly(libs.bundles.groovy)
compileOnly(libs.bundles.spock)
}

configurations.named('api') {
Expand Down
5 changes: 4 additions & 1 deletion dd-java-agent/instrumentation-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ dependencies {
api libs.bytebuddy
api libs.bytebuddyagent
api libs.slf4j
api libs.bundles.spock
api libs.bundles.test.logging
api libs.guava

api project(':dd-java-agent:testing')

implementation project(':dd-java-agent:agent-debugger')

implementation(libs.junit.jupiter)
implementation "org.junit.platform:junit-platform-runner:${libs.versions.junit.platform.get()}"

testImplementation project(':dd-java-agent:instrumentation:trace-annotation')
Expand All @@ -23,4 +23,7 @@ dependencies {
// We have autoservices defined in test subtree, looks like we need this to be able to properly rebuild this
testAnnotationProcessor libs.autoservice.processor
testCompileOnly libs.autoservice.annotation

compileOnly(libs.bundles.groovy)
compileOnly(libs.bundles.spock)
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ csi {
addTestSuiteForDir('latestDepTest', 'test')

dependencies {
testImplementation(libs.javaparser)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering -- do you know why this previously didn't need to be included?

I see that you also included libs.javaparser with your changes in gradle/libs.versions.toml, but if I understand correctly, this library wasn't a part of groovy-all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it is from groovy-all:
./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-15.0:dependencies
Part of the tree:

 org.codehaus.groovy:groovy-all:3.0.24
|    +--- org.codehaus.groovy:groovy-groovydoc:3.0.24
|    |    +--- org.codehaus.groovy:groovy:3.0.24
|    |    \--- com.github.javaparser:javaparser-core:3.25.6

And there usage in tests:
import com.github.javaparser.utils.StringEscapeUtils

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR make that obvious, that we NEVER used groovydoc, but its transitive dependency :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh cool okay, thanks!

testRuntimeOnly project(':dd-java-agent:instrumentation:iast-instrumenter')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dependencies {
testFixturesCompileOnly "org.eclipse.jetty.websocket:websocket-jakarta-server:11.0.0"
testFixturesImplementation group: 'jakarta.websocket', name: 'jakarta.websocket-client-api', version: '2.0.0'

testFixturesCompileOnly(libs.bundles.groovy)

testFixturesImplementation(project(':dd-java-agent:instrumentation-testing')) {
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ dependencies {
testImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
testFixturesImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
testImplementation project(':dd-java-agent:appsec:appsec-test-fixtures')

testFixturesCompileOnly(libs.bundles.groovy)
}
3 changes: 3 additions & 0 deletions dd-java-agent/instrumentation/jms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ dependencies {

latestDepTestImplementation group: 'org.hornetq', name: 'hornetq-jms-client', version: '2.4.7.Final'
latestDepTestImplementation group: 'org.hornetq', name: 'hornetq-jms-server', version: '2.4.7.Final'

// For this module Groovy 3 needs `org.junit.rules.ExternalResource` from JUnit4.
testImplementation(libs.junit4)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ dependencies {
testImplementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.3'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.19.0'

// This module still needs Spock with JUnit4.
testImplementation(libs.spock.junit4)

// Include latest version of kafka itself along with latest version of client libs.
// This seems to help with jar compatibility hell.
latestDepTestImplementation libs.spock.junit4 // This module still needs Spock with JUnit4.
latestDepTestImplementation group: 'org.apache.kafka', name: 'kafka_2.13', version: '2.+'
latestDepTestImplementation group: 'org.apache.kafka', name: 'kafka-clients', version: '2.+'
latestDepTestImplementation group: 'org.apache.kafka', name: 'kafka-streams', version: '2.+'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,7 @@ dependencies {
latestDepTestImplementation libs.kotlin
latestDepTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.+"
latestDepTestImplementation testFixtures(project(':dd-java-agent:instrumentation:kotlin-coroutines'))

testFixturesCompileOnly(libs.bundles.groovy)
testFixturesCompileOnly(libs.bundles.spock)
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dependencies {
testRuntimeOnly files(filterLogbackClassic.map { it.destinationDir })
testRuntimeOnly project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0')

testImplementation(libs.groovy.xml)

webappCompileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
// compileOnly to avoid bringing all the test dependencies to the test app
// these are to be provided by the system classloader on test time
Expand All @@ -50,15 +52,12 @@ dependencies {
add("webappImplementation", testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))) {
transitive = false
}
// use the above instead of:
// webappImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
// because using testFixtures() causes some early evaluation of dependencies
webappRuntimeOnly libs.groovy

webappCompileOnly(libs.bundles.spock)
}

configurations.named("testRuntimeOnly") {
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'org.codehaus.groovy', module: 'groovy-servlet'
}
configurations.named("webappRuntimeClasspath") {
exclude group: 'ch.qos.logback', module: 'logback-classic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ dependencies {
testRuntimeOnly project(':dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0')
testRuntimeOnly files(shadowJar.map { it.archiveFile })

testImplementation(libs.groovy.xml)

webappCompileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '5.0.0'
// compileOnly to avoid bringing all the test dependencies to the test app
// these are to be provided by the system classloader on test time
Expand All @@ -57,10 +59,8 @@ dependencies {
add("webappImplementation", testFixtures(project(':dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0'))) {
transitive = false
}
// use the above instead of:
// webappImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0'))
// because using testFixtures() causes some early evaluation of dependencies
webappRuntimeOnly libs.groovy

webappCompileOnly(libs.bundles.spock)
}

configurations.named("testRuntimeOnly") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tasks.named("test", Test) {
configurations.configureEach {
resolutionStrategy.deactivateDependencyLocking()
}

dependencies {
compileOnly group: 'org.jboss.resteasy', name: 'resteasy-jaxrs', version: '3.0.0.Final'
compileOnly group: 'org.jboss.resteasy', name: 'resteasy-multipart-provider', version: '3.0.0.Final'
Expand All @@ -38,6 +39,8 @@ dependencies {
testFixturesImplementation project(':dd-java-agent:instrumentation-testing'), {
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
}
testFixturesCompileOnly(libs.bundles.groovy)
testFixturesCompileOnly(libs.bundles.spock)

testImplementation project(':dd-java-agent:instrumentation-testing'), {
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ apply from: "$rootDir/gradle/java.gradle"
dependencies {
compileOnly group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'

testImplementation libs.spock.junit4 // This module still needs Spock with JUnit4.
testImplementation group: 'io.dropwizard', name: 'dropwizard-testing', version: '0.7.1'
testImplementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.3'

// This module still needs Spock with JUnit4.
testImplementation(libs.spock.junit4)
}
7 changes: 5 additions & 2 deletions dd-java-agent/instrumentation/selenium/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ dependencies {

testFixturesApi project(':dd-java-agent:agent-ci-visibility:civisibility-instrumentation-test-fixtures')
testFixturesApi project(':dd-java-agent:instrumentation:junit:junit-5.3')
testFixturesApi group: 'org.junit.platform', name: 'junit-platform-launcher', version: libs.versions.junit.platform.get()
testFixturesApi group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: libs.versions.junit5.get()
testFixturesApi(libs.junit.platform.launcher)
testFixturesApi(libs.junit.jupiter.engine)

testFixturesCompileOnly(libs.bundles.groovy)
testFixturesCompileOnly(libs.bundles.spock)

testImplementation group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
testImplementation group: 'org.seleniumhq.selenium', name: 'htmlunit-driver', version: '2.70.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ dependencies {
}
testFixturesCompileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '5.0.0'

testFixturesCompileOnly(libs.bundles.groovy)
testFixturesCompileOnly(libs.bundles.spock)

// tested on tomcat-5.5:latestDepTest
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ dependencies {
}
testFixturesCompileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1'

testFixturesCompileOnly(libs.bundles.groovy)
testFixturesCompileOnly(libs.bundles.spock)

testImplementation(project(':dd-java-agent:instrumentation-testing')) {
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
}
Expand Down
4 changes: 4 additions & 0 deletions dd-java-agent/instrumentation/spark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apply from: "$rootDir/gradle/java.gradle"
configurations.configureEach {
resolutionStrategy.deactivateDependencyLocking()
}

dependencies {
compileOnly group: 'org.apache.spark', name: 'spark-core_2.12', version: '2.4.0'
compileOnly group: 'org.apache.spark', name: 'spark-sql_2.12', version: '2.4.0'
Expand All @@ -20,4 +21,7 @@ dependencies {
testFixturesCompileOnly group: 'org.apache.spark', name: 'spark-core_2.12', version: '2.4.0'
testFixturesCompileOnly group: 'org.apache.spark', name: 'spark-sql_2.12', version: '2.4.0'
testFixturesCompileOnly group: 'org.apache.spark', name: 'spark-yarn_2.12', version: '2.4.0'

testFixturesCompileOnly(libs.bundles.groovy)
testFixturesCompileOnly(libs.bundles.spock)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ dependencies {
testImplementation project(':dd-java-agent:instrumentation:apache-httpclient:apache-httpclient-4.0')
testImplementation project(':dd-java-agent:instrumentation:http-url-connection')

testImplementation libs.spock.spring

// These two version sets are compatible together:
testImplementation enforcedPlatform('org.springframework.boot:spring-boot-dependencies:2.3.5.RELEASE') {
exclude group: 'net.bytebuddy', module: 'byte-buddy' // we don't want this shared dependency pinned
Expand All @@ -64,4 +62,6 @@ dependencies {
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-zuul'
testImplementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind'

testImplementation(libs.spock.spring)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ dependencies {
compileOnly(group: 'org.springframework', name: 'spring-aop', version: '1.2')
implementation project(':dd-java-agent:agent-debugger:debugger-bootstrap')

testImplementation libs.spock.spring
testImplementation group: 'org.springframework', name: 'spring-test', version: '3.0.0.RELEASE'

// JPA dependencies
Expand All @@ -47,6 +46,8 @@ dependencies {
testImplementation group: 'org.hsqldb', name: 'hsqldb', version: '2.0.0'
testImplementation group: 'org.hibernate', name: 'hibernate-entitymanager', version: '4.3.0.Final'

testImplementation(libs.spock.spring)

latestDepTestImplementation group: 'org.springframework', name: 'spring-test', version: '5.+'
latestDepTestImplementation group: 'org.springframework', name: 'spring-context', version: '5.+'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ dependencies {
testImplementation group: 'org.apache.activemq', name: 'activemq-pool', version: '5.14.5'
testImplementation group: 'org.apache.activemq', name: 'activemq-broker', version: '5.14.5'

// For this module Groovy 3 needs `org.junit.rules.ExternalResource` from JUnit4.
testImplementation(libs.junit4)

latestDepTestImplementation group: 'org.springframework', name: 'spring-jms', version: '5.+'
latestDepTestImplementation group: 'org.springframework', name: 'spring-context', version: '5.+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ muzzle {

apply from: "$rootDir/gradle/java.gradle"


addTestSuiteForDir('latestDepTest', 'test')
addTestSuiteForDir('latestBoot20Test', 'bootTest')
addTestSuiteForDir('latestBoot24Test', 'bootTest')
Expand All @@ -86,12 +85,13 @@ dependencies {
testImplementation project(':dd-java-agent:instrumentation:reactor-core-3.1')
testImplementation project(':dd-java-agent:instrumentation:reactive-streams')
testImplementation project(':dd-java-agent:instrumentation:reactor-netty-1')
testImplementation libs.spock.spring

testImplementation group: 'org.springframework', name: 'spring-webflux', version: '5.0.0.RELEASE'
testImplementation group: 'io.projectreactor.ipc', name: 'reactor-netty', version: '0.7.0.RELEASE'
testImplementation group: 'org.springframework', name: 'spring-test', version: '5.0.0.RELEASE'

testImplementation(libs.spock.spring)

latestDepTestImplementation group: 'org.springframework', name: 'spring-webflux', version: '5.+'
// This is the key dep that breaks things, 1.x doesn't work
latestDepTestImplementation group: 'io.projectreactor.netty', name: 'reactor-netty', version: '0.+'
Expand Down
Loading