Skip to content

Commit 99ec62f

Browse files
committed
feat(testing): Add smoke test JUnit framework
1 parent 798798a commit 99ec62f

23 files changed

Lines changed: 2548 additions & 5 deletions

dd-smoke-tests/build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,20 @@ dependencies {
1111

1212
compileOnly(libs.junit.jupiter)
1313

14+
// Testcontainers backs the test-agent .container() backend (TestAgentBackend). Kept compileOnly
15+
// so it is NOT forced onto the ~79 modules that depend on this base for the mock/.external()
16+
// backends; modules using .container() opt in with their own testImplementation dependency.
17+
compileOnly(libs.testcontainers)
18+
1419
compileOnly(libs.bundles.groovy)
1520
compileOnly(libs.bundles.spock)
21+
22+
testImplementation(libs.testcontainers)
23+
}
24+
25+
tasks.withType(Test).configureEach {
26+
// Cap concurrent Testcontainers usage across the build (TestAgentBackend container tests).
27+
usesService(testcontainersLimit)
1628
}
1729

1830
tasks.withType(GroovyCompile).configureEach {
@@ -42,6 +54,13 @@ subprojects { Project subProj ->
4254

4355
// Tests depend on this to know where to run things and what agent jar to use
4456
jvmArgs "-Ddatadog.smoketest.builddir=${buildDir}"
57+
// Forward an optional test-agent image override to the test JVM, so TraceBackend.testAgent()
58+
// runs locally without internal-registry access, e.g.
59+
// -Ddatadog.smoketest(.testagent.image=ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.44.0
60+
def testAgentImage = System.getProperty("datadog.smoketest.testagent.image")
61+
if (testAgentImage != null) {
62+
jvmArgs "-Ddatadog.smoketest.testagent.image=${testAgentImage}"
63+
}
4564
jvmArgumentProviders.add(new CommandLineArgumentProvider() {
4665
@Override
4766
Iterable<String> asArguments() {

dd-smoke-tests/gradle.lockfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCom
1313
com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1414
com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath
1515
com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath
16+
com.fasterxml.jackson.core:jackson-annotations:2.10.3=compileClasspath,testCompileClasspath,testRuntimeClasspath
17+
com.github.docker-java:docker-java-api:3.4.2=compileClasspath,testCompileClasspath,testRuntimeClasspath
18+
com.github.docker-java:docker-java-transport-zerodep:3.4.2=compileClasspath,testCompileClasspath,testRuntimeClasspath
19+
com.github.docker-java:docker-java-transport:3.4.2=compileClasspath,testCompileClasspath,testRuntimeClasspath
1620
com.github.javaparser:javaparser-core:3.25.6=codenarc
1721
com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath
1822
com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath
@@ -47,20 +51,22 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath
4751
io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath
4852
javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
4953
jaxen:jaxen:2.0.0=spotbugs
50-
junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath
54+
junit:junit:4.13.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5155
net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5256
net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5357
net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath
54-
net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath
58+
net.java.dev.jna:jna:5.13.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
59+
net.java.dev.jna:jna:5.8.0=runtimeClasspath
5560
net.sf.saxon:Saxon-HE:12.9=spotbugs
5661
org.apache.ant:ant-antlr:1.10.14=codenarc
5762
org.apache.ant:ant-junit:1.10.14=codenarc
5863
org.apache.bcel:bcel:6.11.0=spotbugs
64+
org.apache.commons:commons-compress:1.24.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
5965
org.apache.commons:commons-lang3:3.19.0=spotbugs
6066
org.apache.commons:commons-text:1.14.0=spotbugs
6167
org.apache.logging.log4j:log4j-api:2.25.2=spotbugs
6268
org.apache.logging.log4j:log4j-core:2.25.2=spotbugs
63-
org.apiguardian:apiguardian-api:1.1.2=compileClasspath,testCompileClasspath
69+
org.apiguardian:apiguardian-api:1.1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
6470
org.codehaus.groovy:groovy-ant:3.0.23=codenarc
6571
org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc
6672
org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc
@@ -73,10 +79,11 @@ org.codehaus.groovy:groovy:3.0.25=compileClasspath,testCompileClasspath,testRunt
7379
org.codenarc:CodeNarc:3.7.0=codenarc
7480
org.dom4j:dom4j:2.2.0=spotbugs
7581
org.gmetrics:GMetrics:2.1.0=codenarc
76-
org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath
82+
org.hamcrest:hamcrest-core:1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
7783
org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
7884
org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath
7985
org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath
86+
org.jetbrains:annotations:17.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
8087
org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8188
org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath
8289
org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath
@@ -104,15 +111,18 @@ org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath
104111
org.ow2.asm:asm-util:9.9=spotbugs
105112
org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
106113
org.ow2.asm:asm:9.9=spotbugs
114+
org.rnorth.duct-tape:duct-tape:1.0.8=compileClasspath,testCompileClasspath,testRuntimeClasspath
107115
org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
108116
org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
109117
org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
110-
org.slf4j:slf4j-api:1.7.32=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
118+
org.slf4j:slf4j-api:1.7.32=runtimeClasspath
119+
org.slf4j:slf4j-api:1.7.36=compileClasspath,testCompileClasspath,testRuntimeClasspath
111120
org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j
112121
org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
113122
org.spockframework:spock-bom:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
114123
org.spockframework:spock-core:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
115124
org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath
116125
org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath
126+
org.testcontainers:testcontainers:1.21.4=compileClasspath,testCompileClasspath,testRuntimeClasspath
117127
org.xmlresolver:xmlresolver:5.3.3=spotbugs
118128
empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor

0 commit comments

Comments
 (0)