Skip to content

Commit 4e3deb4

Browse files
test: introduce FTR smoke tests for headfull and headless modes
1 parent 9e81cc7 commit 4e3deb4

File tree

22 files changed

+1400
-42
lines changed

22 files changed

+1400
-42
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
/dd-java-agent/instrumentation/maven-surefire/ @DataDog/ci-app-libraries-java
8888
/dd-java-agent/instrumentation/weaver/ @DataDog/ci-app-libraries-java
8989
/dd-smoke-tests/gradle/ @DataDog/ci-app-libraries-java
90+
/dd-smoke-tests/junit-console/ @DataDog/ci-app-libraries-java
9091
/dd-smoke-tests/maven/ @DataDog/ci-app-libraries-java
9192
/internal-api/src/main/java/datadog/trace/api/git/ @DataDog/ci-app-libraries-java
9293
**/civisibility/ @DataDog/ci-app-libraries-java

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/CiVisibilitySystem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public static void start(Instrumentation inst, SharedCommunicationObjects sco) {
102102
}
103103

104104
if (executionSettings.isFailedTestReplayEnabled()) {
105-
config.setCiVisibilityFailedTestReplayEnabled(true);
105+
// only marks the feature as active in child or headless processes
106+
config.setCiVisibilityFailedTestReplayActive(true);
106107
}
107108

108109
CiVisibilityCoverageServices.Child coverageServices =

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/BuildSystemModuleImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,13 @@ private Map<String, String> getPropertiesPropagatedToChildProcess(
185185
Strings.propertyNameToSystemPropertyName(CiVisibilityConfig.TEST_MANAGEMENT_ENABLED),
186186
Boolean.toString(executionSettings.getTestManagementSettings().isEnabled()));
187187

188+
propagatedSystemProperties.put(
189+
Strings.propertyNameToSystemPropertyName(
190+
CiVisibilityConfig.TEST_FAILED_TEST_REPLAY_ENABLED),
191+
Boolean.toString(executionSettings.isFailedTestReplayEnabled()));
192+
188193
// enable exception replay if failed test replay is enabled
189194
if (executionSettings.isFailedTestReplayEnabled()) {
190-
propagatedSystemProperties.put(
191-
Strings.propertyNameToSystemPropertyName(
192-
CiVisibilityConfig.TEST_FAILED_TEST_REPLAY_ENABLED),
193-
"true");
194195
propagatedSystemProperties.put(
195196
Strings.propertyNameToSystemPropertyName(DebuggerConfig.EXCEPTION_REPLAY_ENABLED),
196197
"true");

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/DefaultExceptionDebugger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public DefaultExceptionDebugger(
7575
@Override
7676
public void handleException(Throwable t, AgentSpan span) {
7777
// CIVIS Failed Test Replay acts on errors
78-
if (t instanceof Error && !Config.get().isCiVisibilityFailedTestReplayEnabled()) {
78+
if (t instanceof Error && !Config.get().isCiVisibilityFailedTestReplayActive()) {
7979
if (LOGGER.isDebugEnabled()) {
8080
LOGGER.debug("Skip handling error: {}", t.toString());
8181
}
@@ -114,7 +114,7 @@ public void handleException(Throwable t, AgentSpan span) {
114114
exceptionProbeManager.createProbesForException(
115115
throwable.getStackTrace(), chainedExceptionIdx);
116116
if (creationResult.probesCreated > 0) {
117-
if (Config.get().isCiVisibilityFailedTestReplayEnabled()) {
117+
if (Config.get().isCiVisibilityFailedTestReplayActive()) {
118118
// Assume Exception Replay is working under Failed Test Replay logic,
119119
// instrumentation applied sync for immediate test retries
120120
applyExceptionConfiguration(fingerprint);

dd-smoke-tests/backend-mock/src/main/groovy/datadog/smoketest/MockBackend.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class MockBackend implements AutoCloseable {
4040
private boolean knownTestsEnabled = false
4141
private boolean testManagementEnabled = false
4242
private int attemptToFixRetries = 0
43+
private boolean failedTestReplayEnabled = false
4344

4445
void reset() {
4546
receivedTraces.clear()
@@ -61,6 +62,7 @@ class MockBackend implements AutoCloseable {
6162
knownTestsEnabled = false
6263
testManagementEnabled = false
6364
attemptToFixRetries = 0
65+
failedTestReplayEnabled = false
6466
}
6567

6668
@Override
@@ -131,6 +133,10 @@ class MockBackend implements AutoCloseable {
131133
])
132134
}
133135

136+
void givenFailedTestReplay(boolean failedTestReplayEnabled) {
137+
this.failedTestReplayEnabled = failedTestReplayEnabled
138+
}
139+
134140
String getIntakeUrl() {
135141
return intakeServer.address.toString()
136142
}
@@ -177,6 +183,7 @@ class MockBackend implements AutoCloseable {
177183
"flaky_test_retries_enabled": $flakyRetriesEnabled,
178184
"impacted_tests_enabled": $impactedTestsDetectionEnabled,
179185
"known_tests_enabled": $knownTestsEnabled,
186+
"di_enabled": $failedTestReplayEnabled,
180187
"test_management": {
181188
"enabled": $testManagementEnabled,
182189
"attempt_to_fix_retries": $attemptToFixRetries
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import java.time.Duration
2+
import java.time.temporal.ChronoUnit
3+
4+
apply from: "$rootDir/gradle/java.gradle"
5+
description = 'JUnit Console Smoke Tests.'
6+
7+
dependencies {
8+
implementation group: 'org.junit.platform', name: 'junit-platform-console-standalone', version: '1.13.4'
9+
10+
testImplementation project(':dd-smoke-tests:backend-mock')
11+
}
12+
13+
tasks.withType(Test).configureEach {
14+
jvmArgs "-Ddatadog.smoketest.junit.console.jar.path=${configurations.runtimeClasspath.find { it.name.contains('junit-platform-console-standalone') }}"
15+
16+
if (project.hasProperty("mavenRepositoryProxy")) {
17+
// propagate proxy URL to tests, to then propagate it to nested Gradle builds
18+
environment "MAVEN_REPOSITORY_PROXY", project.property("mavenRepositoryProxy")
19+
}
20+
}
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# This is a Gradle generated file for dependency locking.
2+
# Manual edits can break the build and are not advised.
3+
# This file is expected to be part of source control.
4+
cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath
5+
cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath
6+
ch.qos.logback:logback-classic:1.2.3=testCompileClasspath,testRuntimeClasspath
7+
ch.qos.logback:logback-core:1.2.3=testCompileClasspath,testRuntimeClasspath
8+
com.beust:jcommander:1.78=testRuntimeClasspath
9+
com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath
10+
com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath
11+
com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath
12+
com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath
13+
com.datadoghq:java-dogstatsd-client:4.4.3=testRuntimeClasspath
14+
com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath
15+
com.fasterxml.jackson.core:jackson-annotations:2.16.0=testCompileClasspath,testRuntimeClasspath
16+
com.fasterxml.jackson.core:jackson-core:2.16.0=testCompileClasspath,testRuntimeClasspath
17+
com.fasterxml.jackson.core:jackson-databind:2.16.0=testCompileClasspath,testRuntimeClasspath
18+
com.fasterxml.jackson:jackson-bom:2.16.0=testCompileClasspath,testRuntimeClasspath
19+
com.github.javaparser:javaparser-core:3.25.6=testCompileClasspath,testRuntimeClasspath
20+
com.github.jnr:jffi:1.3.13=testRuntimeClasspath
21+
com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath
22+
com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath
23+
com.github.jnr:jnr-enxio:0.32.17=testRuntimeClasspath
24+
com.github.jnr:jnr-ffi:2.2.16=testRuntimeClasspath
25+
com.github.jnr:jnr-posix:3.1.19=testRuntimeClasspath
26+
com.github.jnr:jnr-unixsocket:0.38.22=testRuntimeClasspath
27+
com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath
28+
com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
29+
com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs
30+
com.github.spotbugs:spotbugs:4.7.3=spotbugs
31+
com.github.stefanbirkner:system-rules:1.19.0=testCompileClasspath,testRuntimeClasspath
32+
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
33+
com.google.code.gson:gson:2.9.1=spotbugs
34+
com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath
35+
com.google.re2j:re2j:1.7=testRuntimeClasspath
36+
com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testRuntimeClasspath
37+
com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath
38+
com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath
39+
com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath
40+
com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath
41+
com.thoughtworks.qdox:qdox:1.12.1=testRuntimeClasspath
42+
com.vaadin.external.google:android-json:0.0.20131108.vaadin1=testCompileClasspath,testRuntimeClasspath
43+
commons-codec:commons-codec:1.15=spotbugs
44+
commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath
45+
commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath
46+
de.thetaphi:forbiddenapis:3.8=compileClasspath
47+
info.picocli:picocli:4.6.3=testRuntimeClasspath
48+
io.sqreen:libsqreen:15.0.1=testRuntimeClasspath
49+
javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath
50+
jaxen:jaxen:1.2.0=spotbugs
51+
jline:jline:2.14.6=testRuntimeClasspath
52+
junit:junit-dep:4.11=testCompileClasspath,testRuntimeClasspath
53+
junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath
54+
net.bytebuddy:byte-buddy-agent:1.17.5=testCompileClasspath,testRuntimeClasspath
55+
net.bytebuddy:byte-buddy:1.17.5=testCompileClasspath,testRuntimeClasspath
56+
net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath
57+
net.java.dev.jna:jna:5.8.0=testRuntimeClasspath
58+
net.jcip:jcip-annotations:1.0=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
59+
net.minidev:accessors-smart:2.4.9=testRuntimeClasspath
60+
net.minidev:json-smart:2.4.10=testRuntimeClasspath
61+
net.sf.saxon:Saxon-HE:11.4=spotbugs
62+
org.apache.ant:ant-antlr:1.10.15=testRuntimeClasspath
63+
org.apache.ant:ant-antlr:1.9.15=codenarc
64+
org.apache.ant:ant-junit:1.10.15=testRuntimeClasspath
65+
org.apache.ant:ant-junit:1.9.15=codenarc
66+
org.apache.ant:ant-launcher:1.10.15=testRuntimeClasspath
67+
org.apache.ant:ant:1.10.15=testCompileClasspath,testRuntimeClasspath
68+
org.apache.bcel:bcel:6.5.0=spotbugs
69+
org.apache.commons:commons-lang3:3.12.0=spotbugs
70+
org.apache.commons:commons-text:1.10.0=spotbugs
71+
org.apache.httpcomponents.client5:httpclient5:5.1.3=spotbugs
72+
org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=spotbugs
73+
org.apache.httpcomponents.core5:httpcore5:5.1.3=spotbugs
74+
org.apache.logging.log4j:log4j-api:2.19.0=spotbugs
75+
org.apache.logging.log4j:log4j-core:2.19.0=spotbugs
76+
org.apache.maven.wrapper:maven-wrapper:3.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
77+
org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath
78+
org.codehaus.groovy:groovy-all:3.0.24=testCompileClasspath,testRuntimeClasspath
79+
org.codehaus.groovy:groovy-ant:2.5.14=codenarc
80+
org.codehaus.groovy:groovy-ant:3.0.24=testCompileClasspath,testRuntimeClasspath
81+
org.codehaus.groovy:groovy-astbuilder:3.0.24=testCompileClasspath,testRuntimeClasspath
82+
org.codehaus.groovy:groovy-cli-picocli:3.0.24=testCompileClasspath,testRuntimeClasspath
83+
org.codehaus.groovy:groovy-console:3.0.24=testCompileClasspath,testRuntimeClasspath
84+
org.codehaus.groovy:groovy-datetime:3.0.24=testCompileClasspath,testRuntimeClasspath
85+
org.codehaus.groovy:groovy-docgenerator:3.0.24=testCompileClasspath,testRuntimeClasspath
86+
org.codehaus.groovy:groovy-groovydoc:2.5.14=codenarc
87+
org.codehaus.groovy:groovy-groovydoc:3.0.24=testCompileClasspath,testRuntimeClasspath
88+
org.codehaus.groovy:groovy-groovysh:3.0.24=testCompileClasspath,testRuntimeClasspath
89+
org.codehaus.groovy:groovy-jmx:3.0.24=testCompileClasspath,testRuntimeClasspath
90+
org.codehaus.groovy:groovy-json:2.5.14=codenarc
91+
org.codehaus.groovy:groovy-json:3.0.24=testCompileClasspath,testRuntimeClasspath
92+
org.codehaus.groovy:groovy-jsr223:3.0.24=testCompileClasspath,testRuntimeClasspath
93+
org.codehaus.groovy:groovy-macro:3.0.24=testCompileClasspath,testRuntimeClasspath
94+
org.codehaus.groovy:groovy-nio:3.0.24=testCompileClasspath,testRuntimeClasspath
95+
org.codehaus.groovy:groovy-servlet:3.0.24=testCompileClasspath,testRuntimeClasspath
96+
org.codehaus.groovy:groovy-sql:3.0.24=testCompileClasspath,testRuntimeClasspath
97+
org.codehaus.groovy:groovy-swing:3.0.24=testCompileClasspath,testRuntimeClasspath
98+
org.codehaus.groovy:groovy-templates:2.5.14=codenarc
99+
org.codehaus.groovy:groovy-templates:3.0.24=testCompileClasspath,testRuntimeClasspath
100+
org.codehaus.groovy:groovy-test-junit5:3.0.24=testCompileClasspath,testRuntimeClasspath
101+
org.codehaus.groovy:groovy-test:3.0.24=testCompileClasspath,testRuntimeClasspath
102+
org.codehaus.groovy:groovy-testng:3.0.24=testCompileClasspath,testRuntimeClasspath
103+
org.codehaus.groovy:groovy-xml:2.5.14=codenarc
104+
org.codehaus.groovy:groovy-xml:3.0.24=testCompileClasspath,testRuntimeClasspath
105+
org.codehaus.groovy:groovy:2.5.14=codenarc
106+
org.codehaus.groovy:groovy:3.0.24=testCompileClasspath,testRuntimeClasspath
107+
org.codenarc:CodeNarc:2.2.0=codenarc
108+
org.dom4j:dom4j:2.1.3=spotbugs
109+
org.eclipse.jetty:jetty-http:9.4.56.v20240826=testCompileClasspath,testRuntimeClasspath
110+
org.eclipse.jetty:jetty-io:9.4.56.v20240826=testCompileClasspath,testRuntimeClasspath
111+
org.eclipse.jetty:jetty-server:9.4.56.v20240826=testCompileClasspath,testRuntimeClasspath
112+
org.eclipse.jetty:jetty-util:9.4.56.v20240826=testCompileClasspath,testRuntimeClasspath
113+
org.freemarker:freemarker:2.3.31=testCompileClasspath,testRuntimeClasspath
114+
org.gmetrics:GMetrics:1.1=codenarc
115+
org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
116+
org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath
117+
org.jacoco:org.jacoco.core:0.8.12=testRuntimeClasspath
118+
org.jacoco:org.jacoco.report:0.8.12=testRuntimeClasspath
119+
org.jctools:jctools-core:3.3.0=testRuntimeClasspath
120+
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath
121+
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath
122+
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath
123+
org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath
124+
org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath
125+
org.junit.jupiter:junit-jupiter-api:5.12.0=testCompileClasspath,testRuntimeClasspath
126+
org.junit.jupiter:junit-jupiter-engine:5.12.0=testRuntimeClasspath
127+
org.junit.jupiter:junit-jupiter-params:5.12.0=testCompileClasspath,testRuntimeClasspath
128+
org.junit.jupiter:junit-jupiter:5.12.0=testCompileClasspath,testRuntimeClasspath
129+
org.junit.platform:junit-platform-commons:1.12.0=testCompileClasspath,testRuntimeClasspath
130+
org.junit.platform:junit-platform-engine:1.12.0=testCompileClasspath,testRuntimeClasspath
131+
org.junit.platform:junit-platform-launcher:1.12.0=testRuntimeClasspath
132+
org.junit.platform:junit-platform-runner:1.12.0=testRuntimeClasspath
133+
org.junit.platform:junit-platform-suite-api:1.12.0=testRuntimeClasspath
134+
org.junit.platform:junit-platform-suite-commons:1.12.0=testRuntimeClasspath
135+
org.junit:junit-bom:5.12.0=testCompileClasspath,testRuntimeClasspath
136+
org.junit:junit-bom:5.9.1=spotbugs
137+
org.msgpack:jackson-dataformat-msgpack:0.9.6=testCompileClasspath,testRuntimeClasspath
138+
org.msgpack:msgpack-core:0.9.6=testCompileClasspath,testRuntimeClasspath
139+
org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath
140+
org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath
141+
org.ow2.asm:asm-analysis:9.2=testRuntimeClasspath
142+
org.ow2.asm:asm-analysis:9.4=spotbugs
143+
org.ow2.asm:asm-commons:9.4=spotbugs
144+
org.ow2.asm:asm-commons:9.8=testRuntimeClasspath
145+
org.ow2.asm:asm-tree:9.4=spotbugs
146+
org.ow2.asm:asm-tree:9.8=testRuntimeClasspath
147+
org.ow2.asm:asm-util:9.2=testRuntimeClasspath
148+
org.ow2.asm:asm-util:9.4=spotbugs
149+
org.ow2.asm:asm:9.4=spotbugs
150+
org.ow2.asm:asm:9.8=testRuntimeClasspath
151+
org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath
152+
org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath
153+
org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath
154+
org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath
155+
org.slf4j:slf4j-api:1.7.30=testCompileClasspath
156+
org.slf4j:slf4j-api:1.7.36=testRuntimeClasspath
157+
org.slf4j:slf4j-api:2.0.0=spotbugs,spotbugsSlf4j
158+
org.slf4j:slf4j-simple:2.0.0=spotbugsSlf4j
159+
org.snakeyaml:snakeyaml-engine:2.9=testRuntimeClasspath
160+
org.spockframework:spock-core:2.3-groovy-3.0=testCompileClasspath,testRuntimeClasspath
161+
org.spockframework:spock-junit4:2.3-groovy-3.0=testCompileClasspath,testRuntimeClasspath
162+
org.testng:testng:7.5.1=testRuntimeClasspath
163+
org.webjars:jquery:3.5.1=testRuntimeClasspath
164+
org.xmlresolver:xmlresolver:4.4.3=spotbugs
165+
xml-apis:xml-apis:1.4.01=spotbugs
166+
empty=annotationProcessor,shadow,spotbugsPlugins,testAnnotationProcessor

0 commit comments

Comments
 (0)