Skip to content

Commit 2c219fd

Browse files
add di_enabled to settings response
1 parent 2bfc1e8 commit 2c219fd

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class CiVisibilitySettings {
1717
false,
1818
false,
1919
false,
20+
false,
2021
EarlyFlakeDetectionSettings.DEFAULT,
2122
TestManagementSettings.DEFAULT,
2223
null);
@@ -28,6 +29,7 @@ public class CiVisibilitySettings {
2829
private final boolean flakyTestRetriesEnabled;
2930
private final boolean impactedTestsDetectionEnabled;
3031
private final boolean knownTestsEnabled;
32+
private final boolean failedTestReplayEnabled;
3133
private final EarlyFlakeDetectionSettings earlyFlakeDetectionSettings;
3234
private final TestManagementSettings testManagementSettings;
3335
@Nullable private final String defaultBranch;
@@ -40,6 +42,7 @@ public class CiVisibilitySettings {
4042
boolean flakyTestRetriesEnabled,
4143
boolean impactedTestsDetectionEnabled,
4244
boolean knownTestsEnabled,
45+
boolean failedTestReplayEnabled,
4346
EarlyFlakeDetectionSettings earlyFlakeDetectionSettings,
4447
TestManagementSettings testManagementSettings,
4548
@Nullable String defaultBranch) {
@@ -50,6 +53,7 @@ public class CiVisibilitySettings {
5053
this.flakyTestRetriesEnabled = flakyTestRetriesEnabled;
5154
this.impactedTestsDetectionEnabled = impactedTestsDetectionEnabled;
5255
this.knownTestsEnabled = knownTestsEnabled;
56+
this.failedTestReplayEnabled = failedTestReplayEnabled;
5357
this.earlyFlakeDetectionSettings = earlyFlakeDetectionSettings;
5458
this.testManagementSettings = testManagementSettings;
5559
this.defaultBranch = defaultBranch;
@@ -83,6 +87,10 @@ public boolean isKnownTestsEnabled() {
8387
return knownTestsEnabled;
8488
}
8589

90+
public boolean isFailedTestReplayEnabled() {
91+
return failedTestReplayEnabled;
92+
}
93+
8694
public EarlyFlakeDetectionSettings getEarlyFlakeDetectionSettings() {
8795
return earlyFlakeDetectionSettings;
8896
}
@@ -112,6 +120,7 @@ public boolean equals(Object o) {
112120
&& flakyTestRetriesEnabled == that.flakyTestRetriesEnabled
113121
&& impactedTestsDetectionEnabled == that.impactedTestsDetectionEnabled
114122
&& knownTestsEnabled == that.knownTestsEnabled
123+
&& failedTestReplayEnabled == that.failedTestReplayEnabled
115124
&& Objects.equals(earlyFlakeDetectionSettings, that.earlyFlakeDetectionSettings)
116125
&& Objects.equals(testManagementSettings, that.testManagementSettings)
117126
&& Objects.equals(defaultBranch, that.defaultBranch);
@@ -127,6 +136,7 @@ public int hashCode() {
127136
flakyTestRetriesEnabled,
128137
impactedTestsDetectionEnabled,
129138
knownTestsEnabled,
139+
failedTestReplayEnabled,
130140
earlyFlakeDetectionSettings,
131141
testManagementSettings,
132142
defaultBranch);
@@ -154,6 +164,7 @@ public CiVisibilitySettings fromJson(Map<String, Object> json) {
154164
getBoolean(json, "flaky_test_retries_enabled", false),
155165
getBoolean(json, "impacted_tests_enabled", false),
156166
getBoolean(json, "known_tests_enabled", false),
167+
getBoolean(json, "di_enabled", false),
157168
EarlyFlakeDetectionSettings.JsonAdapter.INSTANCE.fromJson(
158169
(Map<String, Object>) json.get("early_flake_detection")),
159170
TestManagementSettings.JsonAdapter.INSTANCE.fromJson(

dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class ConfigurationApiImplTest extends Specification {
5555

5656
where:
5757
agentless | compression | expectedSettings
58-
false | false | new CiVisibilitySettings(false, false, false, false, false, false, false, EarlyFlakeDetectionSettings.DEFAULT, TestManagementSettings.DEFAULT, null)
59-
false | true | new CiVisibilitySettings(true, true, true, true, true, true, true, EarlyFlakeDetectionSettings.DEFAULT, TestManagementSettings.DEFAULT, "main")
60-
true | false | new CiVisibilitySettings(false, true, false, true, false, true, false, new EarlyFlakeDetectionSettings(true, [new ExecutionsByDuration(1000, 3)], 10), new TestManagementSettings(true, 10), "master")
61-
true | true | new CiVisibilitySettings(false, false, true, true, false, false, true, new EarlyFlakeDetectionSettings(true, [new ExecutionsByDuration(5000, 3), new ExecutionsByDuration(120000, 2)], 10), new TestManagementSettings(true, 20), "prod")
58+
false | false | new CiVisibilitySettings(false, false, false, false, false, false, false, false, EarlyFlakeDetectionSettings.DEFAULT, TestManagementSettings.DEFAULT, null)
59+
false | true | new CiVisibilitySettings(true, true, true, true, true, true, true, true, EarlyFlakeDetectionSettings.DEFAULT, TestManagementSettings.DEFAULT, "main")
60+
true | false | new CiVisibilitySettings(false, true, false, true, false, true, false, true, new EarlyFlakeDetectionSettings(true, [new ExecutionsByDuration(1000, 3)], 10), new TestManagementSettings(true, 10), "master")
61+
true | true | new CiVisibilitySettings(false, false, true, true, false, false, true, false, new EarlyFlakeDetectionSettings(true, [new ExecutionsByDuration(5000, 3), new ExecutionsByDuration(120000, 2)], 10), new TestManagementSettings(true, 20), "prod")
6262
}
6363

6464
def "test skippable tests request"() {

dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-response.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"flaky_test_retries_enabled": ${settings.flakyTestRetriesEnabled?c},
1111
"impacted_tests_enabled": ${settings.impactedTestsDetectionEnabled?c},
1212
"known_tests_enabled": ${settings.knownTestsEnabled?c},
13+
"di_enabled": ${settings.failedTestReplayEnabled?c},
1314
<#if settings.defaultBranch??>
1415
"default_branch": "${settings.defaultBranch}",
1516
</#if>

0 commit comments

Comments
 (0)