From a3dd9fa007054df300d8c909cfc3625341a42b95 Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko Date: Wed, 22 Jan 2025 14:08:17 +0100 Subject: [PATCH 1/3] Always request known tests from the backend --- .../agent-ci-visibility/build.gradle | 2 +- .../config/CiVisibilitySettings.java | 45 +- .../civisibility/config/ConfigurationApi.java | 2 + .../config/ConfigurationApiImpl.java | 14 +- .../config/EarlyFlakeDetectionSettings.java | 8 + .../config/ExecutionSettingsFactoryImpl.java | 86 ++- .../config/TracerEnvironment.java | 20 + .../trace/civisibility/domain/TestImpl.java | 14 + .../events/NoOpTestEventsHandler.java | 2 +- .../events/TestEventsHandlerImpl.java | 9 +- .../trace/civisibility/retry/NeverRetry.java | 7 + .../civisibility/retry/RetryIfFailed.java | 9 + .../trace/civisibility/retry/RetryNTimes.java | 9 + .../config/ConfigurationApiImplTest.groovy | 712 +++++------------- .../civisibility/config/diffs-request.ftl | 29 + .../civisibility/config/diffs-response.ftl | 13 + .../config/flaky-request-one-module.ftl | 30 + .../civisibility/config/flaky-request.ftl | 29 + .../config/flaky-response-one-module.ftl | 18 + .../civisibility/config/flaky-response.ftl | 34 + .../config/known-tests-request.ftl | 29 + .../config/known-tests-response.ftl | 26 + .../civisibility/config/settings-request.ftl | 29 + .../civisibility/config/settings-response.ftl | 24 + .../config/skippable-request-one-module.ftl | 30 + .../civisibility/config/skippable-request.ftl | 29 + .../config/skippable-response-one-module.ftl | 41 + .../config/skippable-response.ftl | 43 ++ .../civisibility/CiVisibilityTestUtils.groovy | 2 +- .../junit4/CucumberTracingListener.java | 2 +- .../junit4/MUnitTracingListener.java | 4 +- .../junit4/JUnit4TracingListener.java | 2 +- .../junit5/CucumberTracingListener.java | 2 +- .../junit5/SpockTracingListener.java | 2 +- .../junit5/JUnitPlatformUtils.java | 17 +- .../junit5/TracingListener.java | 2 +- .../retry/JUnit5RetryInstrumentation.java | 2 + .../junit5/retry/TestDescriptorHandle.java | 6 +- .../karate/KarateRetryInstrumentation.java | 3 +- .../karate/KarateTracingHook.java | 2 +- .../scalatest/DatadogReporter.java | 2 +- .../testng/TracingListener.java | 8 +- .../testng/retry/RetryAnalyzer.java | 4 +- .../weaver/DatadogWeaverReporter.java | 4 +- .../trace/api/config/CiVisibilityConfig.java | 2 + internal-api/build.gradle | 7 +- .../main/java/datadog/trace/api/Config.java | 7 + .../events/TestEventsHandler.java | 18 +- .../civisibility/retry/TestRetryPolicy.java | 9 + .../telemetry/CiVisibilityCountMetric.java | 10 +- .../CiVisibilityDistributionMetric.java | 6 +- .../tag/ImpactedTestsDetectionEnabled.java | 12 + .../telemetry/tag/KnownTestsEnabled.java | 12 + .../telemetry/tag/RetryReason.java | 19 + .../bootstrap/instrumentation/api/Tags.java | 1 + 55 files changed, 885 insertions(+), 625 deletions(-) create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-request.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-response.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request-one-module.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response-one-module.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-request.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-response.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-request.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-response.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request-one-module.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response-one-module.ftl create mode 100644 dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response.ftl create mode 100644 internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/ImpactedTestsDetectionEnabled.java create mode 100644 internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/KnownTestsEnabled.java create mode 100644 internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/RetryReason.java diff --git a/dd-java-agent/agent-ci-visibility/build.gradle b/dd-java-agent/agent-ci-visibility/build.gradle index 92329277890..4cd0f623c03 100644 --- a/dd-java-agent/agent-ci-visibility/build.gradle +++ b/dd-java-agent/agent-ci-visibility/build.gradle @@ -43,7 +43,7 @@ dependencies { testFixturesApi project(':utils:test-utils') testFixturesApi group: 'org.skyscreamer', name: 'jsonassert', version: '1.5.1' - testFixturesApi group: 'org.freemarker', name: 'freemarker', version: '2.3.30' + testFixturesApi group: 'org.freemarker', name: 'freemarker', version: '2.3.31' testFixturesApi group: 'com.jayway.jsonpath', name: 'json-path', version: '2.8.0' testFixturesApi group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.16.0' testFixturesApi group: 'org.msgpack', name: 'jackson-dataformat-msgpack', version: '0.9.6' diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/CiVisibilitySettings.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/CiVisibilitySettings.java index a1686897a16..49c8b79715c 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/CiVisibilitySettings.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/CiVisibilitySettings.java @@ -3,12 +3,13 @@ import com.squareup.moshi.FromJson; import java.nio.file.Path; import java.util.Map; +import java.util.Objects; public class CiVisibilitySettings { public static final CiVisibilitySettings DEFAULT = new CiVisibilitySettings( - false, false, false, false, false, false, EarlyFlakeDetectionSettings.DEFAULT); + false, false, false, false, false, false, false, EarlyFlakeDetectionSettings.DEFAULT); private final boolean itrEnabled; private final boolean codeCoverage; @@ -16,15 +17,17 @@ public class CiVisibilitySettings { private final boolean requireGit; private final boolean flakyTestRetriesEnabled; private final boolean impactedTestsDetectionEnabled; + private final boolean knownTestsEnabled; private final EarlyFlakeDetectionSettings earlyFlakeDetectionSettings; - private CiVisibilitySettings( + CiVisibilitySettings( boolean itrEnabled, boolean codeCoverage, boolean testsSkipping, boolean requireGit, boolean flakyTestRetriesEnabled, boolean impactedTestsDetectionEnabled, + boolean knownTestsEnabled, EarlyFlakeDetectionSettings earlyFlakeDetectionSettings) { this.itrEnabled = itrEnabled; this.codeCoverage = codeCoverage; @@ -32,6 +35,7 @@ private CiVisibilitySettings( this.requireGit = requireGit; this.flakyTestRetriesEnabled = flakyTestRetriesEnabled; this.impactedTestsDetectionEnabled = impactedTestsDetectionEnabled; + this.knownTestsEnabled = knownTestsEnabled; this.earlyFlakeDetectionSettings = earlyFlakeDetectionSettings; } @@ -59,10 +63,46 @@ public boolean isImpactedTestsDetectionEnabled() { return impactedTestsDetectionEnabled; } + public boolean isKnownTestsEnabled() { + return knownTestsEnabled; + } + public EarlyFlakeDetectionSettings getEarlyFlakeDetectionSettings() { return earlyFlakeDetectionSettings; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CiVisibilitySettings that = (CiVisibilitySettings) o; + return itrEnabled == that.itrEnabled + && codeCoverage == that.codeCoverage + && testsSkipping == that.testsSkipping + && requireGit == that.requireGit + && flakyTestRetriesEnabled == that.flakyTestRetriesEnabled + && impactedTestsDetectionEnabled == that.impactedTestsDetectionEnabled + && knownTestsEnabled == that.knownTestsEnabled + && Objects.equals(earlyFlakeDetectionSettings, that.earlyFlakeDetectionSettings); + } + + @Override + public int hashCode() { + return Objects.hash( + itrEnabled, + codeCoverage, + testsSkipping, + requireGit, + flakyTestRetriesEnabled, + impactedTestsDetectionEnabled, + knownTestsEnabled, + earlyFlakeDetectionSettings); + } + public interface Factory { CiVisibilitySettings create(Path path); } @@ -84,6 +124,7 @@ public CiVisibilitySettings fromJson(Map json) { getBoolean(json, "require_git", false), getBoolean(json, "flaky_test_retries_enabled", false), getBoolean(json, "impacted_tests_enabled", false), + getBoolean(json, "known_tests_enabled", false), EarlyFlakeDetectionSettingsJsonAdapter.INSTANCE.fromJson( (Map) json.get("early_flake_detection"))); } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java index bafd88f8e59..dfdf2a409e0 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java @@ -5,6 +5,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Map; +import javax.annotation.Nullable; public interface ConfigurationApi { @@ -45,6 +46,7 @@ public ChangedFiles getChangedFiles(TracerEnvironment tracerEnvironment) { Map> getFlakyTestsByModule(TracerEnvironment tracerEnvironment) throws IOException; + @Nullable Map> getKnownTestsByModule(TracerEnvironment tracerEnvironment) throws IOException; diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java index 947804e4320..00fcd5e6193 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java @@ -16,8 +16,10 @@ import datadog.trace.api.civisibility.telemetry.tag.CoverageEnabled; import datadog.trace.api.civisibility.telemetry.tag.EarlyFlakeDetectionEnabled; import datadog.trace.api.civisibility.telemetry.tag.FlakyTestRetriesEnabled; +import datadog.trace.api.civisibility.telemetry.tag.ImpactedTestsDetectionEnabled; import datadog.trace.api.civisibility.telemetry.tag.ItrEnabled; import datadog.trace.api.civisibility.telemetry.tag.ItrSkipEnabled; +import datadog.trace.api.civisibility.telemetry.tag.KnownTestsEnabled; import datadog.trace.api.civisibility.telemetry.tag.RequireGit; import datadog.trace.civisibility.communication.TelemetryListener; import java.io.File; @@ -141,6 +143,8 @@ public CiVisibilitySettings getSettings(TracerEnvironment tracerEnvironment) thr ? EarlyFlakeDetectionEnabled.TRUE : null, settings.isFlakyTestRetriesEnabled() ? FlakyTestRetriesEnabled.TRUE : null, + settings.isKnownTestsEnabled() ? KnownTestsEnabled.TRUE : null, + settings.isImpactedTestsDetectionEnabled() ? ImpactedTestsDetectionEnabled.TRUE : null, settings.isGitUploadRequired() ? RequireGit.TRUE : null); return settings; @@ -238,6 +242,7 @@ public Map> getFlakyTestsByModule( return testIdentifiers; } + @Nullable @Override public Map> getKnownTestsByModule( TracerEnvironment tracerEnvironment) throws IOException { @@ -289,7 +294,14 @@ private Map> parseTestIdentifiers(KnownTestsD LOGGER.debug("Received {} known tests in total", knownTestsCount); metricCollector.add(CiVisibilityDistributionMetric.EFD_RESPONSE_TESTS, knownTestsCount); - return testIdentifiers; + return knownTestsCount > 0 + ? testIdentifiers + // returning null if there are no known tests: + // this will disable the features that are reliant on known tests + // and is done on purpose: + // if no tests are known, this is likely the first execution for this repository, + // and we want to fill the backend with the initial set of tests + : null; } @Override diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/EarlyFlakeDetectionSettings.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/EarlyFlakeDetectionSettings.java index 13482c0cc24..5a8123487e9 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/EarlyFlakeDetectionSettings.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/EarlyFlakeDetectionSettings.java @@ -71,6 +71,14 @@ public ExecutionsByDuration(long durationMillis, int executions) { this.executions = executions; } + public long getDurationMillis() { + return durationMillis; + } + + public int getExecutions() { + return executions; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java index 85564b55280..f92fb5274e2 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; +import java.util.function.Function; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.slf4j.Logger; @@ -113,14 +114,41 @@ private TracerEnvironment buildTracerEnvironment( } private @Nonnull Map create(TracerEnvironment tracerEnvironment) { - CiVisibilitySettings ciVisibilitySettings = getCiVisibilitySettings(tracerEnvironment); - - boolean itrEnabled = isItrEnabled(ciVisibilitySettings); - boolean codeCoverageEnabled = isCodeCoverageEnabled(ciVisibilitySettings); - boolean testSkippingEnabled = isTestSkippingEnabled(ciVisibilitySettings); - boolean flakyTestRetriesEnabled = isFlakyTestRetriesEnabled(ciVisibilitySettings); - boolean impactedTestsDetectionEnabled = isImpactedTestsDetectionEnabled(ciVisibilitySettings); - boolean earlyFlakeDetectionEnabled = isEarlyFlakeDetectionEnabled(ciVisibilitySettings); + CiVisibilitySettings settings = getCiVisibilitySettings(tracerEnvironment); + + boolean itrEnabled = + isFeatureEnabled( + settings, CiVisibilitySettings::isItrEnabled, Config::isCiVisibilityItrEnabled); + boolean codeCoverageEnabled = + isFeatureEnabled( + settings, + CiVisibilitySettings::isCodeCoverageEnabled, + Config::isCiVisibilityCodeCoverageEnabled); + boolean testSkippingEnabled = + isFeatureEnabled( + settings, + CiVisibilitySettings::isTestsSkippingEnabled, + Config::isCiVisibilityTestSkippingEnabled); + boolean flakyTestRetriesEnabled = + isFeatureEnabled( + settings, + CiVisibilitySettings::isFlakyTestRetriesEnabled, + Config::isCiVisibilityFlakyRetryEnabled); + boolean impactedTestsDetectionEnabled = + isFeatureEnabled( + settings, + CiVisibilitySettings::isImpactedTestsDetectionEnabled, + Config::isCiVisibilityImpactedTestsDetectionEnabled); + boolean earlyFlakeDetectionEnabled = + isFeatureEnabled( + settings, + s -> s.getEarlyFlakeDetectionSettings().isEnabled(), + Config::isCiVisibilityEarlyFlakeDetectionEnabled); + boolean knownTestsRequest = + isFeatureEnabled( + settings, + CiVisibilitySettings::isKnownTestsEnabled, + Config::isCiVisibilityKnownTestsRequestEnabled); LOGGER.info( "CI Visibility settings ({}, {}/{}/{}):\n" @@ -129,6 +157,7 @@ private TracerEnvironment buildTracerEnvironment( + "Tests skipping - {},\n" + "Early flakiness detection - {},\n" + "Impacted tests detection - {},\n" + + "Known tests marking - {},\n" + "Auto test retries - {}", repositoryRoot, tracerEnvironment.getConfigurations().getRuntimeName(), @@ -139,6 +168,7 @@ private TracerEnvironment buildTracerEnvironment( testSkippingEnabled, earlyFlakeDetectionEnabled, impactedTestsDetectionEnabled, + knownTestsRequest, flakyTestRetriesEnabled); String itrCorrelationId = null; @@ -163,11 +193,7 @@ private TracerEnvironment buildTracerEnvironment( : null; Map> knownTestsByModule = - earlyFlakeDetectionEnabled - || CIConstants.FAIL_FAST_TEST_ORDER.equalsIgnoreCase( - config.getCiVisibilityTestOrder()) - ? getKnownTestsByModule(tracerEnvironment) - : null; + knownTestsRequest ? getKnownTestsByModule(tracerEnvironment) : null; Set moduleNames = new HashSet<>(Collections.singleton(DEFAULT_SETTINGS)); moduleNames.addAll(skippableTestIdentifiers.keySet()); @@ -191,7 +217,7 @@ private TracerEnvironment buildTracerEnvironment( flakyTestRetriesEnabled, impactedTestsDetectionEnabled, earlyFlakeDetectionEnabled - ? ciVisibilitySettings.getEarlyFlakeDetectionSettings() + ? settings.getEarlyFlakeDetectionSettings() : EarlyFlakeDetectionSettings.DEFAULT, itrCorrelationId, skippableTestIdentifiers.getOrDefault(moduleName, Collections.emptyMap()), @@ -225,33 +251,11 @@ private CiVisibilitySettings getCiVisibilitySettings(TracerEnvironment tracerEnv } } - private boolean isItrEnabled(CiVisibilitySettings ciVisibilitySettings) { - return ciVisibilitySettings.isItrEnabled() && config.isCiVisibilityItrEnabled(); - } - - private boolean isTestSkippingEnabled(CiVisibilitySettings ciVisibilitySettings) { - return ciVisibilitySettings.isTestsSkippingEnabled() - && config.isCiVisibilityTestSkippingEnabled(); - } - - private boolean isCodeCoverageEnabled(CiVisibilitySettings ciVisibilitySettings) { - return ciVisibilitySettings.isCodeCoverageEnabled() - && config.isCiVisibilityCodeCoverageEnabled(); - } - - private boolean isFlakyTestRetriesEnabled(CiVisibilitySettings ciVisibilitySettings) { - return ciVisibilitySettings.isFlakyTestRetriesEnabled() - && config.isCiVisibilityFlakyRetryEnabled(); - } - - private boolean isImpactedTestsDetectionEnabled(CiVisibilitySettings ciVisibilitySettings) { - return ciVisibilitySettings.isImpactedTestsDetectionEnabled() - && config.isCiVisibilityImpactedTestsDetectionEnabled(); - } - - private boolean isEarlyFlakeDetectionEnabled(CiVisibilitySettings ciVisibilitySettings) { - return ciVisibilitySettings.getEarlyFlakeDetectionSettings().isEnabled() - && config.isCiVisibilityEarlyFlakeDetectionEnabled(); + private boolean isFeatureEnabled( + CiVisibilitySettings ciVisibilitySettings, + Function remoteSetting, + Function killSwitch) { + return remoteSetting.apply(ciVisibilitySettings) && killSwitch.apply(config); } @Nullable diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java index 57bceaea094..e622bb14021 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java @@ -40,6 +40,26 @@ public String getSha() { return sha; } + public String getService() { + return service; + } + + public String getEnv() { + return env; + } + + public String getRepositoryUrl() { + return repositoryUrl; + } + + public String getBranch() { + return branch; + } + + public String getTestLevel() { + return testLevel; + } + public Configurations getConfigurations() { return configurations; } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java index 47446da810b..46248ff19b1 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java @@ -22,6 +22,7 @@ import datadog.trace.api.civisibility.telemetry.tag.IsNew; import datadog.trace.api.civisibility.telemetry.tag.IsRetry; import datadog.trace.api.civisibility.telemetry.tag.IsRum; +import datadog.trace.api.civisibility.telemetry.tag.RetryReason; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.api.gateway.RequestContextSlot; import datadog.trace.bootstrap.instrumentation.api.AgentScope; @@ -265,12 +266,25 @@ public void end(@Nullable Long endTime) { span.getTag(Tags.TEST_IS_NEW) != null ? IsNew.TRUE : null, span.getTag(Tags.TEST_IS_MODIFIED) != null ? IsModified.TRUE : null, span.getTag(Tags.TEST_IS_RETRY) != null ? IsRetry.TRUE : null, + getRetryReason(), span.getTag(Tags.TEST_IS_RUM_ACTIVE) != null ? IsRum.TRUE : null, CIConstants.SELENIUM_BROWSER_DRIVER.equals(span.getTag(Tags.TEST_BROWSER_DRIVER)) ? BrowserDriver.SELENIUM : null); } + private RetryReason getRetryReason() { + String retryReason = (String) span.getTag(Tags.TEST_RETRY_REASON); + if (retryReason != null) { + try { + return RetryReason.valueOf(retryReason.toUpperCase()); + } catch (IllegalArgumentException e) { + log.debug("Non-standard retry-reason: {}", retryReason); + } + } + return null; + } + /** * Tests often perform operations that involve APM instrumentations: sending an HTTP request, * executing a database query, etc. APM instrumentations create spans that correspond to those diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/NoOpTestEventsHandler.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/NoOpTestEventsHandler.java index 9cdec4df5b5..30903cf1170 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/NoOpTestEventsHandler.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/NoOpTestEventsHandler.java @@ -56,7 +56,7 @@ public void onTestStart( @Nullable String testParameters, @Nullable Collection categories, @Nonnull TestSourceData testSourceData, - boolean isRetry, + String retryReason, @Nullable Long startTime) { // do nothing } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/TestEventsHandlerImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/TestEventsHandlerImpl.java index cfbe534a2f0..10c6f9b9274 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/TestEventsHandlerImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/events/TestEventsHandlerImpl.java @@ -137,8 +137,8 @@ public void onTestStart( final @Nullable String testParameters, final @Nullable Collection categories, final @Nonnull TestSourceData testSourceData, - final boolean isRetry, - @Nullable Long startTime) { + final @Nullable String retryReason, + final @Nullable Long startTime) { if (skipTrace(testSourceData.getTestClass())) { return; } @@ -196,8 +196,9 @@ public void onTestStart( } } - if (isRetry) { + if (retryReason != null) { test.setTag(Tags.TEST_IS_RETRY, true); + test.setTag(Tags.TEST_RETRY_REASON, retryReason); } inProgressTests.put(descriptor, test); @@ -253,7 +254,7 @@ public void onTestIgnore( testParameters, categories, testSourceData, - false, + null, null); onTestSkip(testDescriptor, reason); onTestFinish(testDescriptor, null); diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/NeverRetry.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/NeverRetry.java index dc5479090af..978ad1cded8 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/NeverRetry.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/NeverRetry.java @@ -1,6 +1,7 @@ package datadog.trace.civisibility.retry; import datadog.trace.api.civisibility.retry.TestRetryPolicy; +import org.jetbrains.annotations.Nullable; public class NeverRetry implements TestRetryPolicy { @@ -27,4 +28,10 @@ public boolean retry(boolean successful, long duration) { public boolean currentExecutionIsRetry() { return false; } + + @Nullable + @Override + public String currentExecutionRetryReason() { + return null; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryIfFailed.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryIfFailed.java index 45437990a14..ae192e25d66 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryIfFailed.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryIfFailed.java @@ -2,10 +2,13 @@ import datadog.trace.api.civisibility.retry.TestRetryPolicy; import java.util.concurrent.atomic.AtomicInteger; +import org.jetbrains.annotations.Nullable; /** Retries a test case if it failed, up to a maximum number of times. */ public class RetryIfFailed implements TestRetryPolicy { + private static final String AUTO_TEST_RETRIES = "atr"; + private final int maxExecutions; private int executions; @@ -42,4 +45,10 @@ public boolean retry(boolean successful, long duration) { public boolean currentExecutionIsRetry() { return executions > 0; } + + @Nullable + @Override + public String currentExecutionRetryReason() { + return currentExecutionIsRetry() ? AUTO_TEST_RETRIES : null; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryNTimes.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryNTimes.java index 3e9c5699546..5f5cb03dedf 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryNTimes.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/retry/RetryNTimes.java @@ -2,10 +2,13 @@ import datadog.trace.api.civisibility.retry.TestRetryPolicy; import datadog.trace.civisibility.config.EarlyFlakeDetectionSettings; +import org.jetbrains.annotations.Nullable; /** Retries a test case N times (N depends on test duration) regardless of success or failure. */ public class RetryNTimes implements TestRetryPolicy { + private static final String EARLY_FLAKINESS_DETECTION = "efd"; + private final EarlyFlakeDetectionSettings earlyFlakeDetectionSettings; private int executions; private int maxExecutions; @@ -38,4 +41,10 @@ public boolean retry(boolean successful, long duration) { public boolean currentExecutionIsRetry() { return executions > 0; } + + @Nullable + @Override + public String currentExecutionRetryReason() { + return currentExecutionIsRetry() ? EARLY_FLAKINESS_DETECTION : null; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy index e6e472245c2..54a67336b2c 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy +++ b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy @@ -1,6 +1,5 @@ package datadog.trace.civisibility.config -import com.squareup.moshi.Moshi import datadog.communication.BackendApi import datadog.communication.BackendApiFactory import datadog.communication.EvpProxyApi @@ -11,14 +10,14 @@ import datadog.trace.agent.test.server.http.TestHttpServer import datadog.trace.api.civisibility.config.TestIdentifier import datadog.trace.api.civisibility.config.TestMetadata import datadog.trace.api.civisibility.telemetry.CiVisibilityMetricCollector +import datadog.trace.civisibility.CiVisibilityTestUtils import okhttp3.HttpUrl import okhttp3.OkHttpClient import org.apache.commons.io.IOUtils -import spock.lang.AutoCleanup -import spock.lang.Shared +import org.skyscreamer.jsonassert.JSONAssert +import org.skyscreamer.jsonassert.JSONCompareMode import spock.lang.Specification -import java.util.concurrent.TimeUnit import java.util.function.Function import java.util.zip.GZIPOutputStream @@ -28,477 +27,61 @@ class ConfigurationApiImplTest extends Specification { private static final int REQUEST_TIMEOUT_MILLIS = 15_000 - @Shared - Moshi moshi = new Moshi.Builder().build() - - @Shared - @AutoCleanup - TestHttpServer intakeServer = httpServer { - handlers { - prefix("/api/v2/libraries/tests/services/setting") { - def requestJson = moshi.adapter(Map).fromJson(new String(request.body)) - boolean expectedRequest = requestJson == [ - "data": [ - "type" : "ci_app_test_service_libraries_settings", - "id" : "1234", - "attributes": [ - "service" : "foo", - "env" : "foo_env", - "repository_url": "https://github.com/DataDog/foo", - "branch" : "prod", - "sha" : "d64185e45d1722ab3a53c45be47accae", - "test_level" : "test", - "configurations": [ - "os.platform" : "linux", - "os.architecture" : "amd64", - "os.arch" : "amd64", - "os.version" : "bionic", - "runtime.name" : "runtimeName", - "runtime.version" : "runtimeVersion", - "runtime.vendor" : "vendor", - "runtime.architecture": "amd64", - "custom" : [ - "customTag": "customValue" - ] - ] - ] - ] - ] - - def response = response - if (expectedRequest) { - def responseBody = ('{' + - ' "data": {' + - ' "type": "ci_app_tracers_test_service_settings",' + - ' "id": "uuid",' + - ' "attributes": {' + - ' "code_coverage": true,' + - ' "tests_skipping": true,' + - ' "require_git": true,' + - ' "flaky_test_retries_enabled": true,' + - ' "impacted_tests_enabled": true,' + - ' "early_flake_detection": {' + - ' "enabled": true,' + - ' "slow_test_retries": {' + - ' "5s": 10,' + - ' "10s": 5,' + - ' "30s": 3,' + - ' "5m": 2' + - ' },' + - ' "faulty_session_threshold": 30' + - ' }' + - ' }' + - ' }' + - '}').bytes + private static final String REQUEST_UID = "1234" - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } else { - response.status(400).send() - } - } - - prefix("/api/v2/ci/tests/skippable") { - def requestJson = moshi.adapter(Map).fromJson(new String(request.body)) - - // assert request contents - def requestData = requestJson['data'] - if (requestData['type'] != "test_params" - || requestData['id'] != "1234" - ) { - response.status(400).send() - return - } - - def requestAttrs = requestData['attributes'] - if (requestAttrs['service'] != "foo" - || requestAttrs['env'] != "foo_env" - || requestAttrs['repository_url'] != "https://github.com/DataDog/foo" - || requestAttrs['branch'] != "prod" - || requestAttrs['sha'] != "d64185e45d1722ab3a53c45be47accae" - || requestAttrs['test_level'] != "test" - ) { - response.status(400).send() - return - } - - def requestConfs = requestAttrs['configurations'] - if (requestConfs['os.platform'] != "linux" - || requestConfs['os.architecture'] != "amd64" - || requestConfs['os.arch'] != "amd64" - || requestConfs['os.version'] != "bionic" - || requestConfs['runtime.name'] != "runtimeName" - || requestConfs['runtime.version'] != "runtimeVersion" - || requestConfs['runtime.vendor'] != "vendor" - || requestConfs['runtime.architecture'] != "amd64" - || requestConfs['custom']['customTag'] != "customValue" - ) { - response.status(400).send() - return - } - - def testBundle = requestConfs['test.bundle'] - - def moduleATest = """{ - "id": "49968354e2091cdb", - "type": "test", - "attributes": { - "configurations": { - ${!testBundle ? '"test.bundle": "testBundle-a",' : ""} - "custom": { - "customTag": "customValue" - } - }, - "suite": "suite-a", - "name": "name-a", - "parameters": "parameters-a", - "_missing_line_code_coverage": true - } - }""" - - def moduleBTest = """{ - "id": "49968354e2091cdc", - "type": "test", - "attributes": { - "configurations": { - ${!testBundle ? '"test.bundle": "testBundle-b",' : ""} - "custom": { - "customTag": "customValue" - } - }, - "suite": "suite-b", - "name": "name-b", - "parameters": "parameters-b" - } - }""" - - def tests = [] - if (!testBundle || testBundle == 'testBundle-a') { - tests << moduleATest - } - if (!testBundle || testBundle == 'testBundle-b') { - tests << moduleBTest - } - - def response = response - def responseBody = """ -{ - "data": [ - ${tests.join(',')} - ], - "meta": { - "correlation_id": "11223344", - "coverage": { - "src/main/java/Calculator.java": "/8AA/w==", - "src/main/java/utils/Math.java": "AAAAf+AA/A==", - "src/test/java/CalculatorTest.java": "//AAeAAA/A==" - } - } -} -""".bytes - - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } - - prefix("/api/v2/ci/libraries/tests/flaky") { - def requestJson = moshi.adapter(Map).fromJson(new String(request.body)) - - // assert request contents - def requestData = requestJson['data'] - if (requestData['type'] != "flaky_test_from_libraries_params" - || requestData['id'] != "1234" - ) { - response.status(400).send() - return - } - - def requestAttrs = requestData['attributes'] - if (requestAttrs['service'] != "foo" - || requestAttrs['env'] != "foo_env" - || requestAttrs['repository_url'] != "https://github.com/DataDog/foo" - || requestAttrs['branch'] != "prod" - || requestAttrs['sha'] != "d64185e45d1722ab3a53c45be47accae" - || requestAttrs['test_level'] != "test" - ) { - response.status(400).send() - return - } - - def requestConfs = requestAttrs['configurations'] - if (requestConfs['os.platform'] != "linux" - || requestConfs['os.architecture'] != "amd64" - || requestConfs['os.arch'] != "amd64" - || requestConfs['os.version'] != "bionic" - || requestConfs['runtime.name'] != "runtimeName" - || requestConfs['runtime.version'] != "runtimeVersion" - || requestConfs['runtime.vendor'] != "vendor" - || requestConfs['runtime.architecture'] != "amd64" - || requestConfs['custom']['customTag'] != "customValue" - ) { - response.status(400).send() - return - } - - def testBundle = requestConfs['test.bundle'] - - def moduleATest = """{ - "id": "49968354e2091cdb", - "type": "test", - "attributes": { - "configurations": { - ${!testBundle ? '"test.bundle": "testBundle-a",' : ""} - "custom": { - "customTag": "customValue" - } - }, - "suite": "suite-a", - "name": "name-a", - "parameters": "parameters-a", - "_missing_line_code_coverage": true - } - }""" - - def moduleBTest = """{ - "id": "49968354e2091cdc", - "type": "test", - "attributes": { - "configurations": { - ${!testBundle ? '"test.bundle": "testBundle-b",' : ""} - "custom": { - "customTag": "customValue" - } - }, - "suite": "suite-b", - "name": "name-b", - "parameters": "parameters-b" - } - }""" - - def tests = [] - if (!testBundle || testBundle == 'testBundle-a') { - tests << moduleATest - } - if (!testBundle || testBundle == 'testBundle-b') { - tests << moduleBTest - } - - def response = response - def responseBody = """ -{ - "data": [ - ${tests.join(',')} - ], - "meta": { - "correlation_id": "11223344", - "coverage": { - "src/main/java/Calculator.java": "/8AA/w==", - "src/main/java/utils/Math.java": "AAAAf+AA/A==", - "src/test/java/CalculatorTest.java": "//AAeAAA/A==" - } - } -} -""".bytes - - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } - - prefix("/api/v2/ci/libraries/tests") { - def requestJson = moshi.adapter(Map).fromJson(new String(request.body)) - boolean expectedRequest = requestJson == [ - "data": [ - "type" : "ci_app_libraries_tests_request", - "id" : "1234", - "attributes": [ - "service" : "foo", - "env" : "foo_env", - "repository_url": "https://github.com/DataDog/foo", - "branch" : "prod", - "sha" : "d64185e45d1722ab3a53c45be47accae", - "test_level" : "test", - "configurations": [ - "os.platform" : "linux", - "os.architecture" : "amd64", - "os.arch" : "amd64", - "os.version" : "bionic", - "runtime.name" : "runtimeName", - "runtime.version" : "runtimeVersion", - "runtime.vendor" : "vendor", - "runtime.architecture": "amd64", - "custom" : [ - "customTag": "customValue" - ] - ] - ] - ] - ] - - def response = response - if (expectedRequest) { - def responseBody = (""" -{ - "data": { - "id": "9p1jTQLXB8g", - "type": "ci_app_libraries_tests", - "attributes": { - "tests": { - "test-bundle-a": { - "test-suite-a": [ - "test-name-1", - "test-name-2" - ], - "test-suite-b": [ - "another-test-name-1", - "test-name-2" - ] - }, - "test-bundle-N": { - "test-suite-M": [ - "test-name-1", - "test-name-2" - ] - } - } - } - } -} - """).bytes - - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } else { - response.status(400).send() - } - } - - prefix("/api/v2/ci/tests/diffs") { - def requestJson = moshi.adapter(Map).fromJson(new String(request.body)) - - // assert request contents - def requestData = requestJson['data'] - if (requestData['type'] != "ci_app_tests_diffs_request") { - response.status(400).send() - return - } - - def requestAttrs = requestData['attributes'] - if (requestAttrs['service'] != "foo" - || requestAttrs['env'] != "foo_env" - || requestAttrs['repository_url'] != "https://github.com/DataDog/foo" - || requestAttrs['branch'] != "prod" - || requestAttrs['sha'] != "d64185e45d1722ab3a53c45be47accae" - ) { - response.status(400).send() - return - } - - def response = response - def responseBody = """ -{ - "data": { - "type": "ci_app_tests_diffs_response", - "id": "", - "attributes": { - "base_sha": "ef733331f7cee9b1c89d82df87942d8606edf3f7", - "files": [ - "domains/ci-app/apps/apis/rapid-ci-app/internal/itrapihttp/api.go", - "domains/ci-app/apps/apis/rapid-ci-app/internal/itrapihttp/api_test.go" - ] - } - } -} -""".bytes - - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } - } - } - - private static byte[] gzip(byte[] payload) { - def baos = new ByteArrayOutputStream() - try (GZIPOutputStream zip = new GZIPOutputStream(baos)) { - IOUtils.copy(new ByteArrayInputStream(payload), zip) - } - return baos.toByteArray() - } - - def "test settings request: #displayName"() { + def "test settings request"() { given: def tracerEnvironment = givenTracerEnvironment() - def metricCollector = Stub(CiVisibilityMetricCollector) + + def intakeServer = givenBackendEndpoint( + "/api/v2/libraries/tests/services/setting", + "/datadog/trace/civisibility/config/settings-request.ftl", + [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], + "/datadog/trace/civisibility/config/settings-response.ftl", + [settings: expectedSettings] + ) + + def configurationApi = givenConfigurationApi(intakeServer, agentless, compression) when: - def configurationApi = new ConfigurationApiImpl(api, metricCollector, () -> "1234") def settings = configurationApi.getSettings(tracerEnvironment) then: - settings.codeCoverageEnabled - settings.testsSkippingEnabled - settings.gitUploadRequired - settings.flakyTestRetriesEnabled - settings.impactedTestsDetectionEnabled - settings.earlyFlakeDetectionSettings.enabled - settings.earlyFlakeDetectionSettings.faultySessionThreshold == 30 - settings.earlyFlakeDetectionSettings.getExecutions(TimeUnit.SECONDS.toMillis(3)) == 10 - settings.earlyFlakeDetectionSettings.getExecutions(TimeUnit.SECONDS.toMillis(9)) == 5 - settings.earlyFlakeDetectionSettings.getExecutions(TimeUnit.SECONDS.toMillis(29)) == 3 - settings.earlyFlakeDetectionSettings.getExecutions(TimeUnit.MINUTES.toMillis(4)) == 2 - settings.earlyFlakeDetectionSettings.getExecutions(TimeUnit.MINUTES.toMillis(6)) == 0 + settings == expectedSettings + + cleanup: + intakeServer.close() where: - api | displayName - givenEvpProxy(false) | "EVP proxy, compression disabled" - givenEvpProxy(true) | "EVP proxy, compression enabled" - givenIntakeApi(false) | "intake, compression disabled" - givenIntakeApi(true) | "intake, compression enabled" + agentless | compression | expectedSettings + false | false | new CiVisibilitySettings(false, false, false, false, false, false, false, EarlyFlakeDetectionSettings.DEFAULT) + false | true | new CiVisibilitySettings(true, true, true, true, true, true, true, EarlyFlakeDetectionSettings.DEFAULT) + true | false | new CiVisibilitySettings(false, true, false, true, false, true, false, new EarlyFlakeDetectionSettings(true, [new EarlyFlakeDetectionSettings.ExecutionsByDuration(1000, 3)], 10)) + true | true | new CiVisibilitySettings(false, false, true, true, false, false, true, new EarlyFlakeDetectionSettings(true, [ + new EarlyFlakeDetectionSettings.ExecutionsByDuration(5000, 3), + new EarlyFlakeDetectionSettings.ExecutionsByDuration(120000, 2) + ], 10)) } - def "test skippable tests request: #displayName"() { + def "test skippable tests request"() { given: - def tracerEnvironment = givenTracerEnvironment() - def metricCollector = Stub(CiVisibilityMetricCollector) + def tracerEnvironment = givenTracerEnvironment(testBundle) + + def intakeServer = givenBackendEndpoint( + "/api/v2/ci/tests/skippable", + "/datadog/trace/civisibility/config/${request}", + [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], + "/datadog/trace/civisibility/config/${response}", + [:] + ) + + def configurationApi = givenConfigurationApi(intakeServer) when: - def configurationApi = new ConfigurationApiImpl(api, metricCollector, () -> "1234") def skippableTests = configurationApi.getSkippableTests(tracerEnvironment) then: - skippableTests.identifiersByModule == [ - "testBundle-a": [ new TestIdentifier("suite-a", "name-a", "parameters-a"): new TestMetadata(true), ], - "testBundle-b": [ new TestIdentifier("suite-b", "name-b", "parameters-b"): new TestMetadata(false) ], - ] + skippableTests.identifiersByModule == expectedTests skippableTests.correlationId == "11223344" @@ -507,83 +90,72 @@ class ConfigurationApiImplTest extends Specification { skippableTests.coveredLinesByRelativeSourcePath["src/test/java/CalculatorTest.java"] == bits(0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 27, 28, 29, 30, 50, 51, 52, 53, 54, 55) skippableTests.coveredLinesByRelativeSourcePath["src/main/java/utils/Math.java"] == bits(24, 25, 26, 27, 28, 29, 30, 37, 38, 39, 50, 51, 52, 53, 54, 55) + cleanup: + intakeServer.close() + where: - api | displayName - givenEvpProxy(false) | "EVP proxy, compression disabled" - givenEvpProxy(true) | "EVP proxy, compression enabled" - givenIntakeApi(false) | "intake, compression disabled" - givenIntakeApi(true) | "intake, compression enabled" + testBundle | request | response | expectedTests + null | "skippable-request.ftl" | "skippable-response.ftl" | [ + "testBundle-a": [(new TestIdentifier("suite-a", "name-a", "parameters-a")): new TestMetadata(true)], + "testBundle-b": [(new TestIdentifier("suite-b", "name-b", null)): new TestMetadata(false)] + ] + "testBundle-a" | "skippable-request-one-module.ftl" | "skippable-response-one-module.ftl" | [ + "testBundle-a": [ + (new TestIdentifier("suite-a", "name-a", "parameters-a")): new TestMetadata(true), + (new TestIdentifier("suite-b", "name-b", null)) : new TestMetadata(true) + ], + ] } - def "test skippable tests request with module name"() { + def "test flaky tests request"() { given: - def tracerEnvironment = givenTracerEnvironment("testBundle-a") - def metricCollector = Stub(CiVisibilityMetricCollector) - def api = givenIntakeApi(false) - - when: - def configurationApi = new ConfigurationApiImpl(api, metricCollector, () -> "1234") - def skippableTests = configurationApi.getSkippableTests(tracerEnvironment) + def tracerEnvironment = givenTracerEnvironment(testBundle) - then: - skippableTests.identifiersByModule == [ - "testBundle-a": [ new TestIdentifier("suite-a", "name-a", "parameters-a"): new TestMetadata(true), ] - ] - } + def intakeServer = givenBackendEndpoint( + "/api/v2/ci/libraries/tests/flaky", + "/datadog/trace/civisibility/config/${request}", + [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], + "/datadog/trace/civisibility/config/${response}", + [:] + ) - def "test flaky tests request: #displayName"() { - given: - def tracerEnvironment = givenTracerEnvironment() - def metricCollector = Stub(CiVisibilityMetricCollector) + def configurationApi = givenConfigurationApi(intakeServer) when: - def configurationApi = new ConfigurationApiImpl(api, metricCollector, () -> "1234") def flakyTests = configurationApi.getFlakyTestsByModule(tracerEnvironment) then: - flakyTests == [ - "testBundle-a": new HashSet<>([ new TestIdentifier("suite-a", "name-a", "parameters-a") ]), - "testBundle-b": new HashSet<>([ new TestIdentifier("suite-b", "name-b", "parameters-b") ]), - ] + flakyTests == expectedTests - where: - api | displayName - givenEvpProxy(false) | "EVP proxy, compression disabled" - givenEvpProxy(true) | "EVP proxy, compression enabled" - givenIntakeApi(false) | "intake, compression disabled" - givenIntakeApi(true) | "intake, compression enabled" - } + cleanup: + intakeServer.close() - def "test flaky tests request with module name"() { - given: - def tracerEnvironment = givenTracerEnvironment("testBundle-a") - def metricCollector = Stub(CiVisibilityMetricCollector) - def api = givenIntakeApi(false) - - when: - def configurationApi = new ConfigurationApiImpl(api, metricCollector, () -> "1234") - def flakyTests = configurationApi.getFlakyTestsByModule(tracerEnvironment) - - then: - flakyTests == [ - "testBundle-a": new HashSet<>([ new TestIdentifier("suite-a", "name-a", "parameters-a") ]) + where: + testBundle | request | response | expectedTests + null | "flaky-request.ftl" | "flaky-response.ftl" | [ + "testBundle-a": new HashSet<>([new TestIdentifier("suite-a", "name-a", "parameters-a")]), + "testBundle-b": new HashSet<>([new TestIdentifier("suite-b", "name-b", "parameters-b")]), + ] + "testBundle-a" | "flaky-request-one-module.ftl" | "flaky-response-one-module.ftl" | [ + "testBundle-a": new HashSet<>([new TestIdentifier("suite-a", "name-a", "parameters-a")]) ] } - private static BitSet bits(int... bits) { - BitSet bitSet = new BitSet() - for (int bit : bits) { - bitSet.set(bit) - } - return bitSet - } - - def "test known tests request: #displayName"() { + def "test known tests request"() { given: def tracerEnvironment = givenTracerEnvironment() + def intakeServer = givenBackendEndpoint( + "/api/v2/ci/libraries/tests", + "/datadog/trace/civisibility/config/known-tests-request.ftl", + [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], + "/datadog/trace/civisibility/config/known-tests-response.ftl", + [:] + ) + + def configurationApi = givenConfigurationApi(intakeServer) + when: - def configurationApi = new ConfigurationApiImpl(api, Stub(CiVisibilityMetricCollector), () -> "1234") def knownTests = configurationApi.getKnownTestsByModule(tracerEnvironment) for (Map.Entry> e : knownTests.entrySet()) { @@ -606,21 +178,25 @@ class ConfigurationApiImplTest extends Specification { ] ] - where: - api | displayName - givenEvpProxy(false) | "EVP proxy, response compression disabled" - givenEvpProxy(true) | "EVP proxy, response compression enabled" - givenIntakeApi(false) | "intake, response compression disabled" - givenIntakeApi(true) | "intake, response compression enabled" + cleanup: + intakeServer.close() } def "test changed files request"() { given: def tracerEnvironment = givenTracerEnvironment() + def intakeServer = givenBackendEndpoint( + "/api/v2/ci/tests/diffs", + "/datadog/trace/civisibility/config/diffs-request.ftl", + [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], + "/datadog/trace/civisibility/config/diffs-response.ftl", + [:] + ) + + def configurationApi = givenConfigurationApi(intakeServer) + when: - def api = givenIntakeApi(true) - def configurationApi = new ConfigurationApiImpl(api, Stub(CiVisibilityMetricCollector), () -> "1234") def changedFiles = configurationApi.getChangedFiles(tracerEnvironment) then: @@ -631,16 +207,62 @@ class ConfigurationApiImplTest extends Specification { ]) } - private BackendApi givenEvpProxy(boolean responseCompression) { + private ConfigurationApi givenConfigurationApi(TestHttpServer intakeServer, boolean agentless = true, boolean compression = true) { + def api = agentless + ? givenIntakeApi(intakeServer.address, compression) + : givenEvpProxy(intakeServer.address, compression) + return new ConfigurationApiImpl(api, Stub(CiVisibilityMetricCollector), () -> REQUEST_UID) + } + + private TestHttpServer givenBackendEndpoint(String path, + String requestTemplate, + Map requestData, + String responseTemplate, + Map responseData) { + httpServer { + handlers { + prefix(path) { + def expectedRequestBody = CiVisibilityTestUtils.getFreemarkerTemplate(requestTemplate, requestData) + + def response = response + try { + JSONAssert.assertEquals(expectedRequestBody, new String(request.body), JSONCompareMode.LENIENT) + } catch (AssertionError error) { + response.status(400).send(error.getMessage().bytes) + } + + def responseBody = CiVisibilityTestUtils.getFreemarkerTemplate(responseTemplate, responseData).bytes + def header = request.getHeader("Accept-Encoding") + def gzipSupported = header != null && header.contains("gzip") + if (gzipSupported) { + response.addHeader("Content-Encoding", "gzip") + responseBody = gzip(responseBody) + } + + response.status(200).send(responseBody) + } + } + } + } + + private static byte[] gzip(byte[] payload) { + def baos = new ByteArrayOutputStream() + try (GZIPOutputStream zip = new GZIPOutputStream(baos)) { + IOUtils.copy(new ByteArrayInputStream(payload), zip) + } + return baos.toByteArray() + } + + private BackendApi givenEvpProxy(URI address, boolean responseCompression) { String traceId = "a-trace-id" - HttpUrl proxyUrl = HttpUrl.get(intakeServer.address) + HttpUrl proxyUrl = HttpUrl.get(address) HttpRetryPolicy.Factory retryPolicyFactory = new HttpRetryPolicy.Factory(5, 100, 2.0) OkHttpClient client = OkHttpUtils.buildHttpClient(proxyUrl, REQUEST_TIMEOUT_MILLIS) return new EvpProxyApi(traceId, proxyUrl, retryPolicyFactory, client, responseCompression) } - private BackendApi givenIntakeApi(boolean responseCompression) { - HttpUrl intakeUrl = HttpUrl.get(String.format("%s/api/%s/", intakeServer.address.toString(), BackendApiFactory.Intake.API.version)) + private BackendApi givenIntakeApi(URI address, boolean responseCompression) { + HttpUrl intakeUrl = HttpUrl.get(String.format("%s/api/%s/", address.toString(), BackendApiFactory.Intake.API.version)) String apiKey = "api-key" String traceId = "a-trace-id" @@ -657,20 +279,28 @@ class ConfigurationApiImplTest extends Specification { private static TracerEnvironment givenTracerEnvironment(String testBundle = null) { return TracerEnvironment.builder() - .service("foo") - .env("foo_env") - .repositoryUrl("https://github.com/DataDog/foo") - .branch("prod") - .sha("d64185e45d1722ab3a53c45be47accae") - .osPlatform("linux") - .osArchitecture("amd64") - .osVersion("bionic") - .runtimeName("runtimeName") - .runtimeVersion("runtimeVersion") - .runtimeVendor("vendor") - .runtimeArchitecture("amd64") - .customTag("customTag", "customValue") - .testBundle(testBundle) - .build() + .service("foo") + .env("foo_env") + .repositoryUrl("https://github.com/DataDog/foo") + .branch("prod") + .sha("d64185e45d1722ab3a53c45be47accae") + .osPlatform("linux") + .osArchitecture("amd64") + .osVersion("bionic") + .runtimeName("runtimeName") + .runtimeVersion("runtimeVersion") + .runtimeVendor("vendor") + .runtimeArchitecture("amd64") + .customTag("customTag", "customValue") + .testBundle(testBundle) + .build() + } + + private static BitSet bits(int ... bits) { + BitSet bitSet = new BitSet() + for (int bit : bits) { + bitSet.set(bit) + } + return bitSet } } diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-request.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-request.ftl new file mode 100644 index 00000000000..fc4ab315577 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-request.ftl @@ -0,0 +1,29 @@ +{ + "data": { + "type" : "ci_app_tests_diffs_request", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-response.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-response.ftl new file mode 100644 index 00000000000..fe0986ed261 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/diffs-response.ftl @@ -0,0 +1,13 @@ +{ + "data": { + "type": "ci_app_tests_diffs_response", + "id": "1235456", + "attributes": { + "base_sha": "ef733331f7cee9b1c89d82df87942d8606edf3f7", + "files": [ + "domains/ci-app/apps/apis/rapid-ci-app/internal/itrapihttp/api.go", + "domains/ci-app/apps/apis/rapid-ci-app/internal/itrapihttp/api_test.go" + ] + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request-one-module.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request-one-module.ftl new file mode 100644 index 00000000000..f62d7f8151a --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request-one-module.ftl @@ -0,0 +1,30 @@ +{ + "data": { + "type" : "flaky_test_from_libraries_params", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "test.bundle" : "testBundle-a", + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request.ftl new file mode 100644 index 00000000000..b0c43efa092 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-request.ftl @@ -0,0 +1,29 @@ +{ + "data": { + "type" : "flaky_test_from_libraries_params", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response-one-module.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response-one-module.ftl new file mode 100644 index 00000000000..2bfb225f0da --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response-one-module.ftl @@ -0,0 +1,18 @@ +{ + "data": [ + { + "id": "49968354e2091cdb", + "type": "test", + "attributes": { + "configurations": { + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-a", + "name": "name-a", + "parameters": "parameters-a" + } + } + ] +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response.ftl new file mode 100644 index 00000000000..dd5a8392bba --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/flaky-response.ftl @@ -0,0 +1,34 @@ +{ + "data": [ + { + "id": "49968354e2091cdb", + "type": "test", + "attributes": { + "configurations": { + "test.bundle": "testBundle-a", + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-a", + "name": "name-a", + "parameters": "parameters-a" + } + }, + { + "id": "49968354e2091cdb", + "type": "test", + "attributes": { + "configurations": { + "test.bundle": "testBundle-b", + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-b", + "name": "name-b", + "parameters": "parameters-b" + } + } + ] +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-request.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-request.ftl new file mode 100644 index 00000000000..4b9593e0a43 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-request.ftl @@ -0,0 +1,29 @@ +{ + "data": { + "type" : "ci_app_libraries_tests_request", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-response.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-response.ftl new file mode 100644 index 00000000000..98c22839499 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/known-tests-response.ftl @@ -0,0 +1,26 @@ +{ + "data": { + "id": "9p1jTQLXB8g", + "type": "ci_app_libraries_tests", + "attributes": { + "tests": { + "test-bundle-a": { + "test-suite-a": [ + "test-name-1", + "test-name-2" + ], + "test-suite-b": [ + "another-test-name-1", + "test-name-2" + ] + }, + "test-bundle-N": { + "test-suite-M": [ + "test-name-1", + "test-name-2" + ] + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-request.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-request.ftl new file mode 100644 index 00000000000..7544585c51a --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-request.ftl @@ -0,0 +1,29 @@ +{ + "data": { + "type" : "ci_app_test_service_libraries_settings", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-response.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-response.ftl new file mode 100644 index 00000000000..b657dd3fac5 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/settings-response.ftl @@ -0,0 +1,24 @@ +{ + "data": { + "type": "ci_app_tracers_test_service_settings", + "id": "uuid", + "attributes": { + "itr_enabled": ${settings.itrEnabled?c}, + "code_coverage": ${settings.codeCoverageEnabled?c}, + "tests_skipping": ${settings.testsSkippingEnabled?c}, + "require_git": ${settings.gitUploadRequired?c}, + "flaky_test_retries_enabled": ${settings.flakyTestRetriesEnabled?c}, + "impacted_tests_enabled": ${settings.impactedTestsDetectionEnabled?c}, + "known_tests_enabled": ${settings.knownTestsEnabled?c}, + "early_flake_detection": { + "enabled": ${settings.earlyFlakeDetectionSettings.enabled?c}, + "slow_test_retries": { + <#list settings.earlyFlakeDetectionSettings.executionsByDuration as execution> + "${(execution.durationMillis > 60000)?then(execution.durationMillis / 60000 + 'm', execution.durationMillis / 1000 + 's')}": ${execution.executions}<#if execution?has_next>, + + }, + "faulty_session_threshold": ${settings.earlyFlakeDetectionSettings.faultySessionThreshold} + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request-one-module.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request-one-module.ftl new file mode 100644 index 00000000000..150e42a85c8 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request-one-module.ftl @@ -0,0 +1,30 @@ +{ + "data": { + "type" : "test_params", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "test.bundle" : "testBundle-a", + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request.ftl new file mode 100644 index 00000000000..e6193334726 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-request.ftl @@ -0,0 +1,29 @@ +{ + "data": { + "type" : "test_params", + "id" : "${uid}", + "attributes": { + "service" : "${tracerEnvironment.service}", + "env" : "${tracerEnvironment.env}", + "repository_url": "${tracerEnvironment.repositoryUrl}", + "branch" : "${tracerEnvironment.branch}", + "sha" : "${tracerEnvironment.sha}", + "test_level" : "${tracerEnvironment.testLevel}", + "configurations": { + "os.platform" : "${tracerEnvironment.configurations.osPlatform}", + "os.architecture" : "${tracerEnvironment.configurations.osArchitecture}", + "os.arch" : "${tracerEnvironment.configurations.osArchitecture}", + "os.version" : "${tracerEnvironment.configurations.osVersion}", + "runtime.name" : "${tracerEnvironment.configurations.runtimeName}", + "runtime.version" : "${tracerEnvironment.configurations.runtimeVersion}", + "runtime.vendor" : "${tracerEnvironment.configurations.runtimeVendor}", + "runtime.architecture": "${tracerEnvironment.configurations.runtimeArchitecture}", + "custom" : { + <#list tracerEnvironment.configurations.custom as customTag, customValue> + "${customTag}": "${customValue}"<#if customTag?has_next>, + + } + } + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response-one-module.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response-one-module.ftl new file mode 100644 index 00000000000..a8a6bcf119c --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response-one-module.ftl @@ -0,0 +1,41 @@ +{ + "data": [ + { + "id": "49968354e2091cdb", + "type": "test", + "attributes": { + "configurations": { + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-a", + "name": "name-a", + "parameters": "parameters-a", + "_missing_line_code_coverage": true + } + }, + { + "id": "49968354e2091cde", + "type": "test", + "attributes": { + "configurations": { + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-b", + "name": "name-b", + "_missing_line_code_coverage": true + } + } + ], + "meta": { + "correlation_id": "11223344", + "coverage": { + "src/main/java/Calculator.java": "/8AA/w==", + "src/main/java/utils/Math.java": "AAAAf+AA/A==", + "src/test/java/CalculatorTest.java": "//AAeAAA/A==" + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response.ftl b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response.ftl new file mode 100644 index 00000000000..007ca52c5d8 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/datadog/trace/civisibility/config/skippable-response.ftl @@ -0,0 +1,43 @@ +{ + "data": [ + { + "id": "49968354e2091cdb", + "type": "test", + "attributes": { + "configurations": { + "test.bundle": "testBundle-a", + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-a", + "name": "name-a", + "parameters": "parameters-a", + "_missing_line_code_coverage": true + } + }, + { + "id": "49968354e2091cdb", + "type": "test", + "attributes": { + "configurations": { + "test.bundle": "testBundle-b", + "custom": { + "customTag": "customValue" + } + }, + "suite": "suite-b", + "name": "name-b", + "_missing_line_code_coverage": false + } + } + ], + "meta": { + "correlation_id": "11223344", + "coverage": { + "src/main/java/Calculator.java": "/8AA/w==", + "src/main/java/utils/Math.java": "AAAAf+AA/A==", + "src/test/java/CalculatorTest.java": "//AAeAAA/A==" + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy b/dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy index f47dd127b36..7a6511fe21b 100644 --- a/dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy +++ b/dd-java-agent/agent-ci-visibility/src/testFixtures/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy @@ -124,7 +124,7 @@ abstract class CiVisibilityTestUtils { } } - private static String getFreemarkerTemplate(String templatePath, Map replacements, List> replacementsSource) { + static String getFreemarkerTemplate(String templatePath, Map replacements, List> replacementsSource = []) { try { Template coveragesTemplate = FREEMARKER.getTemplate(templatePath) StringWriter coveragesOut = new StringWriter() diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/CucumberTracingListener.java b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/CucumberTracingListener.java index 13aaa1bd94a..d85e5c0670b 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/CucumberTracingListener.java +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/CucumberTracingListener.java @@ -81,7 +81,7 @@ public void testStarted(final Description description) { null, categories, TestSourceData.UNKNOWN, - retryPolicy != null && retryPolicy.currentExecutionIsRetry(), + retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, null); recordFeatureFileCodeCoverage(description); diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitTracingListener.java b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitTracingListener.java index 499a7b57b0b..5a802139cf3 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitTracingListener.java +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitTracingListener.java @@ -86,7 +86,7 @@ public void testStarted(final Description description) { null, categories, JUnit4Utils.toTestSourceData(description), - retryPolicy != null && retryPolicy.currentExecutionIsRetry(), + retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, null); } @@ -160,7 +160,7 @@ public void testIgnored(final Description description) { null, categories, JUnit4Utils.toTestSourceData(description), - false, + null, null); } TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSkip(testDescriptor, null); diff --git a/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java b/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java index 351d0668a64..d6a92460ff8 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java +++ b/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java @@ -85,7 +85,7 @@ public void testStarted(final Description description) { testParameters, categories, testSourceData, - retryPolicy != null && retryPolicy.currentExecutionIsRetry(), + retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, null); } diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/main/java/datadog/trace/instrumentation/junit5/CucumberTracingListener.java b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/main/java/datadog/trace/instrumentation/junit5/CucumberTracingListener.java index afc8c3f3147..904609e0f06 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/main/java/datadog/trace/instrumentation/junit5/CucumberTracingListener.java +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/main/java/datadog/trace/instrumentation/junit5/CucumberTracingListener.java @@ -123,7 +123,7 @@ private void testResourceExecutionStarted( null, tags, TestSourceData.UNKNOWN, - JUnitPlatformUtils.isRetry(testDescriptor), + JUnitPlatformUtils.retryReason(testDescriptor), null); CoveragePerTestBridge.recordCoverage(classpathResourceName); diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/SpockTracingListener.java b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/SpockTracingListener.java index 450f351ffb2..bd9b58841b7 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/SpockTracingListener.java +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/SpockTracingListener.java @@ -124,7 +124,7 @@ private void testMethodExecutionStarted(TestDescriptor testDescriptor, MethodSou testParameters, tags, testSourceData, - JUnitPlatformUtils.isRetry(testDescriptor), + JUnitPlatformUtils.retryReason(testDescriptor), null); } diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java index ee2ce6bd6d8..8de02e6002c 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java @@ -34,6 +34,7 @@ */ public abstract class JUnitPlatformUtils { + public static final String RETRY_DESCRIPTOR_REASON_SUFFIX = "retry-reason"; public static final String RETRY_DESCRIPTOR_ID_SUFFIX = "retry-attempt"; private static final Logger LOGGER = LoggerFactory.getLogger(JUnitPlatformUtils.class); @@ -184,11 +185,23 @@ public static boolean isParameterizedTest(TestDescriptor testDescriptor) { return "test-template".equals(lastSegment.getType()); } + public static String retryReason(TestDescriptor testDescriptor) { + return getIDSegmentValue(testDescriptor, RETRY_DESCRIPTOR_REASON_SUFFIX); + } + public static boolean isRetry(TestDescriptor testDescriptor) { + return getIDSegmentValue(testDescriptor, RETRY_DESCRIPTOR_ID_SUFFIX) != null; + } + + private static String getIDSegmentValue(TestDescriptor testDescriptor, String segmentName) { UniqueId uniqueId = testDescriptor.getUniqueId(); List segments = uniqueId.getSegments(); - UniqueId.Segment lastSegment = segments.get(segments.size() - 1); - return RETRY_DESCRIPTOR_ID_SUFFIX.equals(lastSegment.getType()); + for (UniqueId.Segment segment : segments) { + if (segmentName.equals(segment.getType())) { + return segment.getValue(); + } + } + return null; } public static TestDescriptor getSuiteDescriptor(TestDescriptor testDescriptor) { diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TracingListener.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TracingListener.java index 3d5eb401581..77fbc39e13e 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TracingListener.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TracingListener.java @@ -124,7 +124,7 @@ private void testMethodExecutionStarted(TestDescriptor testDescriptor, MethodSou testParameters, tags, testSourceData, - JUnitPlatformUtils.isRetry(testDescriptor), + JUnitPlatformUtils.retryReason(testDescriptor), null); } diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5RetryInstrumentation.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5RetryInstrumentation.java index 9d6ba1fd36c..d589851e4e8 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5RetryInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5RetryInstrumentation.java @@ -182,6 +182,8 @@ public static Boolean execute(@Advice.This HierarchicalTestExecutorService.TestT */ TestDescriptor retryDescriptor = descriptorHandle.withIdSuffix( + JUnitPlatformUtils.RETRY_DESCRIPTOR_REASON_SUFFIX, + retryPolicy.currentExecutionRetryReason(), JUnitPlatformUtils.RETRY_DESCRIPTOR_ID_SUFFIX, String.valueOf(++retryAttemptIdx)); taskHandle.setTestDescriptor(retryDescriptor); taskHandle.setNode((Node) retryDescriptor); diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestDescriptorHandle.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestDescriptorHandle.java index 96cf6c0568a..00638b007fc 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestDescriptorHandle.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestDescriptorHandle.java @@ -42,9 +42,11 @@ public TestDescriptorHandle(TestDescriptor testDescriptor) { this.testDescriptor = UnsafeUtils.tryShallowClone(testDescriptor); } - public TestDescriptor withIdSuffix(String segmentName, String segmentValue) { + public TestDescriptor withIdSuffix( + String segmentName, String segmentValue, String otherSegmentName, String otherSegmentValue) { UniqueId uniqueId = testDescriptor.getUniqueId(); - UniqueId updatedId = uniqueId.append(segmentName, segmentValue); + UniqueId updatedId = + uniqueId.append(segmentName, segmentValue).append(otherSegmentName, otherSegmentValue); TestDescriptor descriptorClone = UnsafeUtils.tryShallowClone(testDescriptor); METHOD_HANDLES.invoke(UNIQUE_ID_SETTER, descriptorClone, updatedId); return descriptorClone; diff --git a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateRetryInstrumentation.java b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateRetryInstrumentation.java index b67302e72c8..129d32f68e9 100644 --- a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateRetryInstrumentation.java +++ b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateRetryInstrumentation.java @@ -94,7 +94,8 @@ public static void afterExecute(@Advice.This ScenarioRuntime scenarioRuntime) { if (retryPolicy.retry(!retryContext.getAndResetFailed(), duration)) { ScenarioRuntime retry = new ScenarioRuntime(scenarioRuntime.featureRuntime, scenarioRuntime.scenario); - retry.magicVariables.put(KarateUtils.RETRY_MAGIC_VARIABLE, true); + retry.magicVariables.put( + KarateUtils.RETRY_MAGIC_VARIABLE, retryPolicy.currentExecutionRetryReason()); retry.run(); retry.featureRuntime.result.addResult(retry.result); } diff --git a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java index c6058083ff7..6a221b7b4f8 100644 --- a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java +++ b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java @@ -139,7 +139,7 @@ public boolean beforeScenario(ScenarioRuntime sr) { parameters, categories, TestSourceData.UNKNOWN, - sr.magicVariables.containsKey(KarateUtils.RETRY_MAGIC_VARIABLE), + (String) sr.magicVariables.get(KarateUtils.RETRY_MAGIC_VARIABLE), null); return true; } diff --git a/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/DatadogReporter.java b/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/DatadogReporter.java index 86eb1a3a184..ce28947a8b8 100644 --- a/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/DatadogReporter.java +++ b/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/DatadogReporter.java @@ -155,7 +155,7 @@ private static void onTestStart(TestStarting event) { testParameters, categories, new TestSourceData(testClass, null, null), - retryPolicy != null && retryPolicy.currentExecutionIsRetry(), + retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, null); } diff --git a/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/TracingListener.java b/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/TracingListener.java index d4bb61a3bc6..edb2346bfab 100644 --- a/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/TracingListener.java +++ b/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/TracingListener.java @@ -90,17 +90,17 @@ public void onTestStart(final ITestResult result) { testParameters, groups, testSourceData, - isRetry(result), + retryReason(result), null); } - private boolean isRetry(final ITestResult result) { + private String retryReason(final ITestResult result) { IRetryAnalyzer retryAnalyzer = TestNGUtils.getRetryAnalyzer(result); if (retryAnalyzer instanceof RetryAnalyzer) { RetryAnalyzer datadogAnalyzer = (RetryAnalyzer) retryAnalyzer; - return datadogAnalyzer.currentExecutionIsRetry(); + return datadogAnalyzer.currentExecutionRetryReason(); } - return false; + return null; } @Override diff --git a/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/retry/RetryAnalyzer.java b/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/retry/RetryAnalyzer.java index 8af7aa7a7f3..f108f622d24 100644 --- a/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/retry/RetryAnalyzer.java +++ b/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/retry/RetryAnalyzer.java @@ -31,7 +31,7 @@ public boolean retry(ITestResult result) { return retryPolicy.retry(result.isSuccess(), result.getEndMillis() - result.getStartMillis()); } - public boolean currentExecutionIsRetry() { - return retryPolicy != null && retryPolicy.currentExecutionIsRetry(); + public String currentExecutionRetryReason() { + return retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null; } } diff --git a/dd-java-agent/instrumentation/weaver/src/main/java/datadog/trace/instrumentation/weaver/DatadogWeaverReporter.java b/dd-java-agent/instrumentation/weaver/src/main/java/datadog/trace/instrumentation/weaver/DatadogWeaverReporter.java index fed3a83eefe..4c80e870cae 100644 --- a/dd-java-agent/instrumentation/weaver/src/main/java/datadog/trace/instrumentation/weaver/DatadogWeaverReporter.java +++ b/dd-java-agent/instrumentation/weaver/src/main/java/datadog/trace/instrumentation/weaver/DatadogWeaverReporter.java @@ -91,7 +91,7 @@ public static void onTestFinished(TestFinished event, TaskDef taskDef) { new TestDescriptor(testSuiteName, testClass, testName, testParameters, testQualifier); String testMethodName = null; Method testMethod = null; - boolean isRetry = false; + String retryReason = null; // Only test finish is reported, so fake test start timestamp long endMicros = SystemTimeSource.INSTANCE.getCurrentTimeMicros(); @@ -105,7 +105,7 @@ public static void onTestFinished(TestFinished event, TaskDef taskDef) { testParameters, categories, new TestSourceData(testClass, testMethod, testMethodName), - isRetry, + retryReason, startMicros); if (testOutcome.result() instanceof Result.Ignored) { diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java index c7a2215ae90..b8717125778 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java @@ -54,6 +54,8 @@ public final class CiVisibilityConfig { public static final String CIVISIBILITY_FLAKY_RETRY_ENABLED = "civisibility.flaky.retry.enabled"; public static final String CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED = "civisibility.impacted.tests.detection.enabled"; + public static final String CIVISIBILITY_KNOWN_TESTS_REQUEST_ENABLED = + "civisibility.known.tests.request.enabled"; public static final String CIVISIBILITY_FLAKY_RETRY_ONLY_KNOWN_FLAKES = "civisibility.flaky.retry.only.known.flakes"; public static final String CIVISIBILITY_EARLY_FLAKE_DETECTION_ENABLED = diff --git a/internal-api/build.gradle b/internal-api/build.gradle index dff5bb34505..edf0ac13a24 100644 --- a/internal-api/build.gradle +++ b/internal-api/build.gradle @@ -114,12 +114,9 @@ excludedClassesCoverage += [ "datadog.trace.api.civisibility.events.BuildEventsHandler.ModuleInfo", "datadog.trace.api.civisibility.events.TestDescriptor", "datadog.trace.api.civisibility.events.TestSuiteDescriptor", - "datadog.trace.api.civisibility.telemetry.tag.ErrorType", - "datadog.trace.api.civisibility.telemetry.tag.ExitCode", - "datadog.trace.api.civisibility.telemetry.tag.Library", - "datadog.trace.api.civisibility.telemetry.tag.ResponseCompressed", - "datadog.trace.api.civisibility.telemetry.tag.StatusCode", + "datadog.trace.api.civisibility.telemetry.tag.*", "datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric.IndexHolder", + "datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric", "datadog.trace.api.civisibility.telemetry.CiVisibilityDistributionMetric", "datadog.trace.api.civisibility.telemetry.CiVisibilityMetricData", "datadog.trace.api.civisibility.telemetry.NoOpMetricCollector", diff --git a/internal-api/src/main/java/datadog/trace/api/Config.java b/internal-api/src/main/java/datadog/trace/api/Config.java index 5f3243fe2b4..bd4b3fdb6b7 100644 --- a/internal-api/src/main/java/datadog/trace/api/Config.java +++ b/internal-api/src/main/java/datadog/trace/api/Config.java @@ -358,6 +358,7 @@ public static String getHostName() { private final List ciVisibilityResourceFolderNames; private final boolean ciVisibilityFlakyRetryEnabled; private final boolean ciVisibilityImpactedTestsDetectionEnabled; + private final boolean ciVisibilityKnownTestsRequestEnabled; private final boolean ciVisibilityFlakyRetryOnlyKnownFlakes; private final int ciVisibilityFlakyRetryCount; private final int ciVisibilityTotalFlakyRetryCount; @@ -1497,6 +1498,8 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) configProvider.getBoolean(CIVISIBILITY_FLAKY_RETRY_ENABLED, true); ciVisibilityImpactedTestsDetectionEnabled = configProvider.getBoolean(CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED, true); + ciVisibilityKnownTestsRequestEnabled = + configProvider.getBoolean(CIVISIBILITY_KNOWN_TESTS_REQUEST_ENABLED, true); ciVisibilityFlakyRetryOnlyKnownFlakes = configProvider.getBoolean(CIVISIBILITY_FLAKY_RETRY_ONLY_KNOWN_FLAKES, false); ciVisibilityEarlyFlakeDetectionEnabled = @@ -2912,6 +2915,10 @@ public boolean isCiVisibilityImpactedTestsDetectionEnabled() { return ciVisibilityImpactedTestsDetectionEnabled; } + public boolean isCiVisibilityKnownTestsRequestEnabled() { + return ciVisibilityKnownTestsRequestEnabled; + } + public boolean isCiVisibilityFlakyRetryOnlyKnownFlakes() { return ciVisibilityFlakyRetryOnlyKnownFlakes; } diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/events/TestEventsHandler.java b/internal-api/src/main/java/datadog/trace/api/civisibility/events/TestEventsHandler.java index 49f7d8fda48..2d2903457fd 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/events/TestEventsHandler.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/events/TestEventsHandler.java @@ -38,6 +38,22 @@ void onTestSuiteStart( void onTestSuiteFinish(SuiteKey descriptor, @Nullable Long endTime); + /** + * Reports a "test started" event + * + * @param suiteDescriptor a descriptor uniquely identifying the test's suite + * @param descriptor a descriptor uniquely identifying the test + * @param testName the name of the test case + * @param testFramework name of the testing framework used to run the test case + * @param testFrameworkVersion version of the testing framework used to run the test case + * @param testParameters test parameters (as stringified JSON) if this is a parameterized test + * case + * @param categories test categories (or test tags) if the test case is marked with any + * @param testSourceData metadata for locating the source code for the test case + * @param retryReason if this is a retry of the previously executed test case, the reason for + * retrying + * @param startTime the timestamp of the test execution start ({@code null} for current timestamp) + */ void onTestStart( SuiteKey suiteDescriptor, TestKey descriptor, @@ -47,7 +63,7 @@ void onTestStart( @Nullable String testParameters, @Nullable Collection categories, @Nonnull TestSourceData testSourceData, - boolean isRetry, + @Nullable String retryReason, @Nullable Long startTime); void onTestSkip(TestKey descriptor, @Nullable String reason); diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/retry/TestRetryPolicy.java b/internal-api/src/main/java/datadog/trace/api/civisibility/retry/TestRetryPolicy.java index fab8ae15b10..92db18fc17f 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/retry/TestRetryPolicy.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/retry/TestRetryPolicy.java @@ -1,5 +1,7 @@ package datadog.trace.api.civisibility.retry; +import javax.annotation.Nullable; + public interface TestRetryPolicy { boolean retriesLeft(); @@ -8,4 +10,11 @@ public interface TestRetryPolicy { boolean retry(boolean successful, long duration); boolean currentExecutionIsRetry(); + + /** + * Returns retry reason for current execution (will be {@code null} if current execution is not a + * retry) + */ + @Nullable + String currentExecutionRetryReason(); } diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java index 7dcd91d1164..8b592067bc8 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java @@ -15,6 +15,7 @@ import datadog.trace.api.civisibility.telemetry.tag.FailFastTestOrderEnabled; import datadog.trace.api.civisibility.telemetry.tag.FlakyTestRetriesEnabled; import datadog.trace.api.civisibility.telemetry.tag.HasCodeowner; +import datadog.trace.api.civisibility.telemetry.tag.ImpactedTestsDetectionEnabled; import datadog.trace.api.civisibility.telemetry.tag.IsBenchmark; import datadog.trace.api.civisibility.telemetry.tag.IsHeadless; import datadog.trace.api.civisibility.telemetry.tag.IsModified; @@ -24,9 +25,11 @@ import datadog.trace.api.civisibility.telemetry.tag.IsUnsupportedCI; import datadog.trace.api.civisibility.telemetry.tag.ItrEnabled; import datadog.trace.api.civisibility.telemetry.tag.ItrSkipEnabled; +import datadog.trace.api.civisibility.telemetry.tag.KnownTestsEnabled; import datadog.trace.api.civisibility.telemetry.tag.Provider; import datadog.trace.api.civisibility.telemetry.tag.RequestCompressed; import datadog.trace.api.civisibility.telemetry.tag.RequireGit; +import datadog.trace.api.civisibility.telemetry.tag.RetryReason; import datadog.trace.api.civisibility.telemetry.tag.StatusCode; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import java.util.Arrays; @@ -65,6 +68,7 @@ public enum CiVisibilityCountMetric { IsNew.class, IsModified.class, IsRetry.class, + RetryReason.class, IsRum.class, BrowserDriver.class), /** The number of successfully collected code coverages that are empty */ @@ -108,6 +112,8 @@ public enum CiVisibilityCountMetric { CoverageEnabled.class, EarlyFlakeDetectionEnabled.class, FlakyTestRetriesEnabled.class, + ImpactedTestsDetectionEnabled.class, + KnownTestsEnabled.class, RequireGit.class), /** The number of requests sent to the itr skippable tests endpoint */ ITR_SKIPPABLE_TESTS_REQUEST("itr_skippable_tests.request", RequestCompressed.class), @@ -126,9 +132,9 @@ public enum CiVisibilityCountMetric { */ ITR_FORCED_RUN("itr_forced_run", EventType.class), /** The number of requests sent to the known tests endpoint */ - EFD_REQUEST("early_flake_detection.request", RequestCompressed.class), + EFD_REQUEST("known_tests.request", RequestCompressed.class), /** The number of known tests requests sent to the known tests endpoint that errored */ - EFD_REQUEST_ERRORS("early_flake_detection.request_errors", ErrorType.class, StatusCode.class), + EFD_REQUEST_ERRORS("known_tests.request_errors", ErrorType.class, StatusCode.class), /** The number of requests sent to the flaky tests endpoint */ FLAKY_TESTS_REQUEST("flaky_tests.request", RequestCompressed.class), /** The number of tests requests sent to the flaky tests endpoint that errored */ diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java index a9b3e2c0206..0153aeccedd 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java @@ -40,11 +40,11 @@ public enum CiVisibilityDistributionMetric { /** The number of files covered inside a coverage payload */ CODE_COVERAGE_FILES("code_coverage.files"), /* The time it takes to get the response of the known tests endpoint request in ms */ - EFD_REQUEST_MS("early_flake_detection.request_ms"), + EFD_REQUEST_MS("known_tests.request_ms"), /** The number of bytes received by the known tests endpoint */ - EFD_RESPONSE_BYTES("early_flake_detection.response_bytes", ResponseCompressed.class), + EFD_RESPONSE_BYTES("known_tests.response_bytes", ResponseCompressed.class), /** The number of tests received by the known tests endpoint */ - EFD_RESPONSE_TESTS("early_flake_detection.response_tests"), + EFD_RESPONSE_TESTS("known_tests.response_tests"), /** The time it takes to get the response of the flaky tests endpoint request in ms */ FLAKY_TESTS_REQUEST_MS("flaky_tests.request_ms"), /** The number of bytes received by the flaky tests endpoint */ diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/ImpactedTestsDetectionEnabled.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/ImpactedTestsDetectionEnabled.java new file mode 100644 index 00000000000..3d42030d7e0 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/ImpactedTestsDetectionEnabled.java @@ -0,0 +1,12 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +public enum ImpactedTestsDetectionEnabled implements TagValue { + TRUE; + + @Override + public String asString() { + return "impacted_tests_detection_enabled:true"; + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/KnownTestsEnabled.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/KnownTestsEnabled.java new file mode 100644 index 00000000000..bb07ffc3dc7 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/KnownTestsEnabled.java @@ -0,0 +1,12 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +public enum KnownTestsEnabled implements TagValue { + TRUE; + + @Override + public String asString() { + return "known_tests_enabled:true"; + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/RetryReason.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/RetryReason.java new file mode 100644 index 00000000000..00978213fa8 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/RetryReason.java @@ -0,0 +1,19 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +public enum RetryReason implements TagValue { + ATR, + EFD; + + private final String s; + + RetryReason() { + s = "retry_reason:" + name().toLowerCase(); + } + + @Override + public String asString() { + return s; + } +} diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java index 0adf63b7742..47e4a0d45b3 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java @@ -94,6 +94,7 @@ public class Tags { public static final String TEST_EARLY_FLAKE_ABORT_REASON = "test.early_flake.abort_reason"; public static final String TEST_IS_NEW = "test.is_new"; public static final String TEST_IS_RETRY = "test.is_retry"; + public static final String TEST_RETRY_REASON = "test.retry_reason"; public static final String TEST_IS_MODIFIED = "test.is_modified"; public static final String CI_PROVIDER_NAME = "ci.provider.name"; From 61ffadd341b2d7a1e0e91a4514a69871de83ed27 Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko Date: Wed, 22 Jan 2025 14:13:00 +0100 Subject: [PATCH 2/3] Add test.retry_reason to test fixtures --- .../test-efd-new-scenario-outline-5.4.0/events.ftl | 4 ++++ .../test-efd-new-scenario-outline-latest/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../src/test/resources/test-retry-failure/events.ftl | 4 ++++ .../test-retry-scenario-outline-5.4.0/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test/resources/test-failed-then-succeed/events.ftl | 2 ++ .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test-efd-faulty-session-threshold/events.ftl | 4 ++++ .../test-efd-known-tests-and-new-test/events.ftl | 2 ++ .../resources/test-efd-new-parameterized-test/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test/resources/test-failed-then-succeed/events.ftl | 3 +++ .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 4 ++++ .../test-efd-new-scenario-outline-5.4.0/events.ftl | 4 ++++ .../test-efd-new-scenario-outline-latest/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test-failed-scenario-outline-5.4.0/events.ftl | 4 ++++ .../test-failed-scenario-outline-latest/events.ftl | 4 ++++ .../test/resources/test-failed-then-succeed/events.ftl | 4 +++- .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test-efd-faulty-session-threshold/events.ftl | 4 ++++ .../test-efd-known-tests-and-new-test/events.ftl | 2 ++ .../resources/test-efd-new-parameterized-test/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test/resources/test-failed-then-succeed/events.ftl | 3 +++ .../test-parameterized-failed-then-succeed/events.ftl | 2 ++ .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 4 ++++ .../test-efd-faulty-session-threshold/events.ftl | 4 ++++ .../test-efd-known-tests-and-new-test/events.ftl | 2 ++ .../resources/test-efd-new-parameterized-test/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test/resources/test-failed-then-succeed/events.ftl | 3 +++ .../src/test/resources/test-retry-factory/events.ftl | 4 ++++ .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 8 ++++++++ .../src/test/resources/test-retry-template/events.ftl | 4 ++++ .../test-efd-faulty-session-threshold/events.ftl | 4 ++++ .../resources/test-efd-new-parameterized-test/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test/resources/test-failed-then-succeed/events.ftl | 2 ++ .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 4 ++++ .../test-efd-faulty-session-threshold/events.ftl | 4 ++++ .../src/test/resources/test-efd-new-slow-test/events.ftl | 1 + .../src/test/resources/test-efd-new-test/events.ftl | 2 ++ .../test/resources/test-failed-then-succeed/events.ftl | 2 ++ .../src/test/resources/test-retry-failed/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 4 ++++ .../test/resources/test-failed-then-succeed-6/events.ftl | 2 ++ .../src/test/resources/test-retry-error/events.ftl | 4 ++++ .../src/test/resources/test-retry-failed-6/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 4 ++++ .../test/resources/test-failed-then-succeed-7/events.ftl | 2 ++ .../src/test/resources/test-retry-error/events.ftl | 4 ++++ .../src/test/resources/test-retry-failed-7/events.ftl | 4 ++++ .../test/resources/test-retry-parameterized/events.ftl | 4 ++++ .../test/resources/test-failed-flaky-retries/events.ftl | 4 ++++ .../test_failed_maven_run_flaky_retries/events.ftl | 4 ++++ 68 files changed, 214 insertions(+), 1 deletion(-) diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl index 278461ed354..84ae7f50a94 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl @@ -94,6 +94,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -139,6 +140,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -228,6 +230,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -273,6 +276,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl index acbc458195b..84ed609243c 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl @@ -94,6 +94,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions #1", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -139,6 +140,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions #1", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -228,6 +230,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions #2", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -273,6 +276,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions #2", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl index f078e1adbf3..a8dbd324e27 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl @@ -94,6 +94,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_slow.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-test/events.ftl index b4249edcc4b..e2c2fe1550b 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-efd-new-test/events.ftl @@ -94,6 +94,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -139,6 +140,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-failure/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-failure/events.ftl index fa6f8787e88..a28cbaf5b8a 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-failure/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-failure/events.ftl @@ -98,6 +98,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -145,6 +146,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -192,6 +194,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -239,6 +242,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-scenario-outline-5.4.0/events.ftl index c1f7040efb4..7499518a591 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-scenario-outline-5.4.0/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-retry-scenario-outline-5.4.0/events.ftl @@ -184,6 +184,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples_failed.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -231,6 +232,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples_failed.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -278,6 +280,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples_failed.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -325,6 +328,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples_failed.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl index 31255f7ee07..fefa5428dcb 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-slow-test/events.ftl @@ -168,6 +168,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMUnitSlow", diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-test/events.ftl index bebb3577509..2db5a65169a 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-efd-new-test/events.ftl @@ -169,6 +169,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMUnit", @@ -216,6 +217,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMUnit", diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-then-succeed/events.ftl index a149ef888da..f479a9c9bf7 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-then-succeed/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedThenSucceedMUnit", @@ -217,6 +218,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestFailedThenSucceedMUnit", diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-retry-failed/events.ftl index 3936d0c01bf..9824b20b206 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-retry-failed/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedMUnit", @@ -220,6 +221,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedMUnit", @@ -269,6 +271,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedMUnit", @@ -318,6 +321,7 @@ "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedMUnit", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-faulty-session-threshold/events.ftl index 724fa0fafa1..6c81c7fb448 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-faulty-session-threshold/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -173,6 +173,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", @@ -222,6 +223,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", @@ -323,6 +325,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -374,6 +377,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-known-tests-and-new-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-known-tests-and-new-test/events.ftl index 2d07797fa04..bf4a41fb58a 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-known-tests-and-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-known-tests-and-new-test/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", @@ -220,6 +221,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-parameterized-test/events.ftl index a080d937ddf..ee4dc7e2c68 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-parameterized-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-parameterized-test/events.ftl @@ -175,6 +175,7 @@ "test.module" : "junit-4.10", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"metadata\":{\"test_name\":\"parameterized_test_succeed[str1]\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed()V", "test.status" : "pass", @@ -225,6 +226,7 @@ "test.module" : "junit-4.10", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"metadata\":{\"test_name\":\"parameterized_test_succeed[str1]\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed()V", "test.status" : "pass", @@ -324,6 +326,7 @@ "test.module" : "junit-4.10", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"metadata\":{\"test_name\":\"parameterized_test_succeed[\\\"str2\\\"]\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed()V", "test.status" : "pass", @@ -374,6 +377,7 @@ "test.module" : "junit-4.10", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"metadata\":{\"test_name\":\"parameterized_test_succeed[\\\"str2\\\"]\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-slow-test/events.ftl index 5b792a34254..145ff353be0 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-slow-test/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-test/events.ftl index a853112b597..fd1c1c4f6ba 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-efd-new-test/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_succeed()V", "test.status" : "pass", @@ -220,6 +221,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-then-succeed/events.ftl index 72ecf28affe..6f70ee03e59 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-then-succeed/events.ftl @@ -173,6 +173,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed_then_succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_then_succeed()V", "test.status" : "fail", @@ -224,6 +225,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed_then_succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_then_succeed()V", "test.status" : "fail", @@ -272,6 +274,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed_then_succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_then_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-failed/events.ftl index 384ef1723c4..d4d008f55a7 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-failed/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -221,6 +222,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -271,6 +273,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -321,6 +324,7 @@ "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-parameterized/events.ftl index 1896c0400c6..18c64db1fbd 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-retry-parameterized/events.ftl @@ -175,6 +175,7 @@ "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_failed_parameterized[0 0 42]\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized()V", "test.status" : "fail", @@ -227,6 +228,7 @@ "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_failed_parameterized[0 0 42]\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized()V", "test.status" : "fail", @@ -279,6 +281,7 @@ "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_failed_parameterized[0 0 42]\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized()V", "test.status" : "fail", @@ -331,6 +334,7 @@ "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_failed_parameterized[0 0 42]\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl index f93603d6060..cbff12a25ea 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl @@ -182,6 +182,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -227,6 +228,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -316,6 +318,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #2", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -361,6 +364,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #2", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl index 21a7050825f..40ba8846c29 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-scenario-outline-latest/events.ftl @@ -182,6 +182,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -227,6 +228,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -316,6 +318,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.2", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -361,6 +364,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.2", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl index a42ac33f940..9c86624de09 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl @@ -94,6 +94,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_slow.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-test/events.ftl index acb0f91ec5e..77edf65c23a 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-efd-new-test/events.ftl @@ -94,6 +94,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -139,6 +140,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-5.4.0/events.ftl index 89a2164fb35..04cab3cde63 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-5.4.0/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-5.4.0/events.ftl @@ -98,6 +98,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -145,6 +146,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -192,6 +194,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -239,6 +242,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-latest/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-latest/events.ftl index 71d21d8ef8f..4d5946a9922 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-latest/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-scenario-outline-latest/events.ftl @@ -98,6 +98,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -145,6 +146,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -192,6 +194,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", @@ -239,6 +242,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-then-succeed/events.ftl index b0a33660cb9..45e54ef7fc9 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-then-succeed/events.ftl @@ -96,6 +96,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed_then_succeed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -140,6 +141,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "pass", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed_then_succeed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -231,4 +233,4 @@ }, "type" : "test_module_end", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed/events.ftl index 634a2eb2754..bb58917bee1 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed/events.ftl @@ -98,6 +98,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -145,6 +146,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -192,6 +194,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", @@ -239,6 +242,7 @@ "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "test.traits" : "{\"category\":[\"foo\"]}", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-faulty-session-threshold/events.ftl index 28626e970fc..e49450e4e9f 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-faulty-session-threshold/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -157,6 +157,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failure", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test failure()V", "test.status" : "fail", @@ -209,6 +210,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failure", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test failure()V", "test.status" : "fail", @@ -306,6 +308,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test success()V", "test.status" : "pass", @@ -355,6 +358,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test success()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-known-tests-and-new-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-known-tests-and-new-test/events.ftl index 867667dfb29..cdb22de17df 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-known-tests-and-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-known-tests-and-new-test/events.ftl @@ -153,6 +153,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", @@ -203,6 +204,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-parameterized-test/events.ftl index 44aa916b066..9febaa7661e 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-parameterized-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-parameterized-test/events.ftl @@ -105,6 +105,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", @@ -155,6 +156,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", @@ -254,6 +256,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", @@ -304,6 +307,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl index 9217a1640d7..07d124e0111 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-slow-test/events.ftl @@ -103,6 +103,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test success()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-test/events.ftl index 8e560bcec12..ffe0cd611f5 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-efd-new-test/events.ftl @@ -103,6 +103,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test success()V", "test.status" : "pass", @@ -152,6 +153,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test success()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-then-succeed/events.ftl index 1cc1cdba274..a2d98f91db4 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-then-succeed/events.ftl @@ -109,6 +109,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed then succeed()V", "test.status" : "fail", @@ -161,6 +162,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed then succeed()V", "test.status" : "fail", @@ -210,6 +212,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed then succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-parameterized-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-parameterized-failed-then-succeed/events.ftl index 359f9de8661..ae1d49379e1 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-parameterized-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-parameterized-failed-then-succeed/events.ftl @@ -111,6 +111,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "fail", @@ -161,6 +162,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-failed/events.ftl index da27c5d9131..494677c86bb 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-failed/events.ftl @@ -109,6 +109,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed()V", "test.status" : "fail", @@ -161,6 +162,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed()V", "test.status" : "fail", @@ -213,6 +215,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed()V", "test.status" : "fail", @@ -265,6 +268,7 @@ "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-parameterized/events.ftl index 5a272a67d08..2a2eee0b268 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-retry-parameterized/events.ftl @@ -160,6 +160,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "fail", @@ -213,6 +214,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "fail", @@ -266,6 +268,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "fail", @@ -319,6 +322,7 @@ "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test add #a and #b(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-faulty-session-threshold/events.ftl index 458ea9c1f5e..4ff48b32614 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-faulty-session-threshold/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -173,6 +173,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", @@ -222,6 +223,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", @@ -325,6 +327,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -377,6 +380,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-known-tests-and-new-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-known-tests-and-new-test/events.ftl index 11af8659396..83e962c7cc4 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-known-tests-and-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-known-tests-and-new-test/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", @@ -220,6 +221,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_another_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-parameterized-test/events.ftl index d5f49f6e5dd..3b9cabb13be 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-parameterized-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-parameterized-test/events.ftl @@ -175,6 +175,7 @@ "test.module" : "junit-5.3", "test.name" : "test_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 0, some:\\\"parameter\\\"\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_parameterized(IIILjava/lang/String;)V", "test.status" : "pass", @@ -225,6 +226,7 @@ "test.module" : "junit-5.3", "test.name" : "test_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 0, some:\\\"parameter\\\"\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_parameterized(IIILjava/lang/String;)V", "test.status" : "pass", @@ -324,6 +326,7 @@ "test.module" : "junit-5.3", "test.name" : "test_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 2, some:\\\"parameter\\\"\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_parameterized(IIILjava/lang/String;)V", "test.status" : "pass", @@ -374,6 +377,7 @@ "test.module" : "junit-5.3", "test.name" : "test_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 2, some:\\\"parameter\\\"\"}}", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_parameterized(IIILjava/lang/String;)V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-slow-test/events.ftl index d85b4f6f930..38b620e46ca 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-slow-test/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-test/events.ftl index 813af119691..e89d5033b24 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-efd-new-test/events.ftl @@ -171,6 +171,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_succeed()V", "test.status" : "pass", @@ -220,6 +221,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_succeed", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.source.method" : "test_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-then-succeed/events.ftl index b7d3f1bb64c..3e1299a12be 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-then-succeed/events.ftl @@ -173,6 +173,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_then_succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_then_succeed()V", "test.status" : "fail", @@ -224,6 +225,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_then_succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_then_succeed()V", "test.status" : "fail", @@ -272,6 +274,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_then_succeed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_then_succeed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-factory/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-factory/events.ftl index 382311cbe7f..1163e899b00 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-factory/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-factory/events.ftl @@ -220,6 +220,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_factory", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_factory()Ljava/lang/Iterable;", "test.status" : "fail", @@ -271,6 +272,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_factory", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_factory()Ljava/lang/Iterable;", "test.status" : "fail", @@ -322,6 +324,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_factory", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_factory()Ljava/lang/Iterable;", "test.status" : "fail", @@ -373,6 +376,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_factory", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_factory()Ljava/lang/Iterable;", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-failed/events.ftl index 8eaced5d0d3..b789fefc1bf 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-failed/events.ftl @@ -173,6 +173,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -224,6 +225,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -275,6 +277,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -326,6 +329,7 @@ "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-parameterized/events.ftl index 182b63cfe7c..5aa58f2784b 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-parameterized/events.ftl @@ -175,6 +175,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -227,6 +228,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -279,6 +281,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -331,6 +334,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -434,6 +438,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -486,6 +491,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -538,6 +544,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", @@ -590,6 +597,7 @@ "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 42\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed_parameterized(III)V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-template/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-template/events.ftl index 10b4adb7d92..6a1200c7863 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-template/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-retry-template/events.ftl @@ -175,6 +175,7 @@ "test.module" : "junit-5.3", "test.name" : "test_template", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_template_failed\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_template(Lorg/example/TestFailedTemplate$SampleTestCase;)V", "test.status" : "fail", @@ -227,6 +228,7 @@ "test.module" : "junit-5.3", "test.name" : "test_template", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_template_failed\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_template(Lorg/example/TestFailedTemplate$SampleTestCase;)V", "test.status" : "fail", @@ -279,6 +281,7 @@ "test.module" : "junit-5.3", "test.name" : "test_template", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_template_failed\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_template(Lorg/example/TestFailedTemplate$SampleTestCase;)V", "test.status" : "fail", @@ -331,6 +334,7 @@ "test.module" : "junit-5.3", "test.name" : "test_template", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_template_failed\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_template(Lorg/example/TestFailedTemplate$SampleTestCase;)V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-faulty-session-threshold/events.ftl index a19267e29e1..dddeb50921c 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-faulty-session-threshold/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -599,6 +599,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", "test.type" : "test", @@ -644,6 +645,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", "test.type" : "test", @@ -733,6 +735,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", "test.type" : "test", @@ -778,6 +781,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", "test.type" : "test", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-parameterized-test/events.ftl index 9af698b8c3c..381cce18437 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-parameterized-test/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-parameterized-test/events.ftl @@ -527,6 +527,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized] test parameterized", "test.type" : "test", @@ -572,6 +573,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized] test parameterized", "test.type" : "test", @@ -661,6 +663,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized] test parameterized", "test.type" : "test", @@ -706,6 +709,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_parameterized] test parameterized", "test.type" : "test", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-slow-test/events.ftl index 813a4021b63..37160da944f 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-slow-test/events.ftl @@ -143,6 +143,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "first scenario", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_succeed_slow] test succeed", "test.traits" : "{\"category\":[\"bar\",\"foo\"]}", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-test/events.ftl index 310f16d9883..72606227362 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-efd-new-test/events.ftl @@ -167,6 +167,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "first scenario", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_succeed_one_case] test succeed", "test.traits" : "{\"category\":[\"bar\",\"foo\"]}", @@ -212,6 +213,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "first scenario", + "test.retry_reason" : "efd", "test.status" : "pass", "test.suite" : "[org/example/test_succeed_one_case] test succeed", "test.traits" : "{\"category\":[\"bar\",\"foo\"]}", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-then-succeed/events.ftl index a8329c8487e..b49efb2f751 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-then-succeed/events.ftl @@ -169,6 +169,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "flaky scenario", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed_then_succeed] test failed", "test.type" : "test", @@ -212,6 +213,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "flaky scenario", + "test.retry_reason" : "atr", "test.status" : "pass", "test.suite" : "[org/example/test_failed_then_succeed] test failed", "test.type" : "test", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-failed/events.ftl index a6c7abcb6e3..220f0f7e0ff 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-failed/events.ftl @@ -286,6 +286,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "second scenario", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed] test failed", "test.type" : "test", @@ -332,6 +333,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "second scenario", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed] test failed", "test.type" : "test", @@ -378,6 +380,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "second scenario", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed] test failed", "test.type" : "test", @@ -424,6 +427,7 @@ "test.is_retry" : "true", "test.module" : "karate", "test.name" : "second scenario", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed] test failed", "test.type" : "test", diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-parameterized/events.ftl index f57a0d5cb02..a935537b286 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-retry-parameterized/events.ftl @@ -534,6 +534,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed_parameterized] test parameterized", "test.type" : "test", @@ -581,6 +582,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed_parameterized] test parameterized", "test.type" : "test", @@ -628,6 +630,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed_parameterized] test parameterized", "test.type" : "test", @@ -675,6 +678,7 @@ "test.module" : "karate", "test.name" : "first scenario as an outline", "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "atr", "test.status" : "fail", "test.suite" : "[org/example/test_failed_parameterized] test parameterized", "test.type" : "test", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-faulty-session-threshold/events.ftl index 094a5988762..cbf1ffd36cf 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-faulty-session-threshold/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -100,6 +100,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMoreCases", @@ -146,6 +147,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMoreCases", @@ -282,6 +284,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.subtract subtracts two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMoreCases", @@ -328,6 +331,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.subtract subtracts two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedMoreCases", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-slow-test/events.ftl index 055bca1bfeb..a16541e6286 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-slow-test/events.ftl @@ -100,6 +100,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceedSlow", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-test/events.ftl index 3c8d45f6152..c11c5dc1f45 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-efd-new-test/events.ftl @@ -100,6 +100,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceed", @@ -146,6 +147,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "efd", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestSucceed", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-then-succeed/events.ftl index 1f5bca15045..4086cf54d0c 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-then-succeed/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-then-succeed/events.ftl @@ -104,6 +104,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedThenSucceed", @@ -149,6 +150,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "pass", "test.suite" : "org.example.TestFailedThenSucceed", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-failed/events.ftl index f4078552b53..d9499753bd7 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-failed/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-failed/events.ftl @@ -104,6 +104,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailed", @@ -152,6 +153,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailed", @@ -200,6 +202,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailed", @@ -248,6 +251,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailed", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-parameterized/events.ftl index c53f0088437..895acec8f46 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-retry-parameterized/events.ftl @@ -104,6 +104,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "addition should correctly add two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedParameterized", @@ -152,6 +153,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "addition should correctly add two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedParameterized", @@ -200,6 +202,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "addition should correctly add two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedParameterized", @@ -248,6 +251,7 @@ "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "addition should correctly add two numbers", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.status" : "fail", "test.suite" : "org.example.TestFailedParameterized", diff --git a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-failed-then-succeed-6/events.ftl b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-failed-then-succeed-6/events.ftl index 3cc756c6ea8..de4b40ef19e 100644 --- a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-failed-then-succeed-6/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-failed-then-succeed-6/events.ftl @@ -107,6 +107,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -155,6 +156,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-error/events.ftl b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-error/events.ftl index 174d563b604..964793765fd 100644 --- a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-error/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-error/events.ftl @@ -107,6 +107,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", @@ -158,6 +159,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", @@ -209,6 +211,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", @@ -260,6 +263,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-failed-6/events.ftl b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-failed-6/events.ftl index 0cb1adc4e25..c6d698a14cc 100644 --- a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-failed-6/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-failed-6/events.ftl @@ -107,6 +107,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -158,6 +159,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -209,6 +211,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -260,6 +263,7 @@ "test.is_retry" : "true", "test.module" : "testng-6", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-parameterized/events.ftl index c8f3c9e2307..238c2a39343 100644 --- a/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-6/src/test/resources/test-retry-parameterized/events.ftl @@ -155,6 +155,7 @@ "test.module" : "testng-6", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", @@ -206,6 +207,7 @@ "test.module" : "testng-6", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", @@ -257,6 +259,7 @@ "test.module" : "testng-6", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", @@ -308,6 +311,7 @@ "test.module" : "testng-6", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-then-succeed-7/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-then-succeed-7/events.ftl index f3c8b90bbe9..463aed8c649 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-then-succeed-7/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-then-succeed-7/events.ftl @@ -107,6 +107,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -155,6 +156,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "pass", diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-error/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-error/events.ftl index 7de613032ed..6790eee4224 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-error/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-error/events.ftl @@ -107,6 +107,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", @@ -158,6 +159,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", @@ -209,6 +211,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", @@ -260,6 +263,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_error", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_error()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-failed-7/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-failed-7/events.ftl index aa1b1a25d57..94397e26158 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-failed-7/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-failed-7/events.ftl @@ -107,6 +107,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -158,6 +159,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -209,6 +211,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -260,6 +263,7 @@ "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-parameterized/events.ftl index 64bda798b4b..7ef1dcdbf3f 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-retry-parameterized/events.ftl @@ -155,6 +155,7 @@ "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", @@ -206,6 +207,7 @@ "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", @@ -257,6 +259,7 @@ "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", @@ -308,6 +311,7 @@ "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.retry_reason" : "atr", "test.source.file" : "dummy_source_path", "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", "test.status" : "fail", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl index cee5b0310ff..522e3ac9d39 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl @@ -309,6 +309,7 @@ "test.is_retry" : "true", "test.module" : ":test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -364,6 +365,7 @@ "test.is_retry" : "true", "test.module" : ":test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -419,6 +421,7 @@ "test.is_retry" : "true", "test.module" : ":test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -474,6 +477,7 @@ "test.is_retry" : "true", "test.module" : ":test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", diff --git a/dd-smoke-tests/maven/src/test/resources/test_failed_maven_run_flaky_retries/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_failed_maven_run_flaky_retries/events.ftl index d0fe38a197e..f0256077437 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_failed_maven_run_flaky_retries/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_failed_maven_run_flaky_retries/events.ftl @@ -373,6 +373,7 @@ "test.is_retry" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -428,6 +429,7 @@ "test.is_retry" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -483,6 +485,7 @@ "test.is_retry" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", @@ -538,6 +541,7 @@ "test.is_retry" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", + "test.retry_reason" : "atr", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.source.method" : "test_failed()V", "test.status" : "fail", From 79081f8f82916130320972226e32c8e3c6ffa163 Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko Date: Wed, 22 Jan 2025 14:33:14 +0100 Subject: [PATCH 3/3] Rename EFD metrics constants to known tests --- .../civisibility/config/ConfigurationApiImpl.java | 10 +++++----- .../telemetry/CiVisibilityCountMetric.java | 4 ++-- .../telemetry/CiVisibilityDistributionMetric.java | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java index 00fcd5e6193..3b4f9a22d2d 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java @@ -248,10 +248,10 @@ public Map> getKnownTestsByModule( TracerEnvironment tracerEnvironment) throws IOException { OkHttpUtils.CustomListener telemetryListener = new TelemetryListener.Builder(metricCollector) - .requestCount(CiVisibilityCountMetric.EFD_REQUEST) - .requestErrors(CiVisibilityCountMetric.EFD_REQUEST_ERRORS) - .requestDuration(CiVisibilityDistributionMetric.EFD_REQUEST_MS) - .responseBytes(CiVisibilityDistributionMetric.EFD_RESPONSE_BYTES) + .requestCount(CiVisibilityCountMetric.KNOWN_TESTS_REQUEST) + .requestErrors(CiVisibilityCountMetric.KNOWN_TESTS_REQUEST_ERRORS) + .requestDuration(CiVisibilityDistributionMetric.KNOWN_TESTS_REQUEST_MS) + .responseBytes(CiVisibilityDistributionMetric.KNOWN_TESTS_RESPONSE_BYTES) .build(); String uuid = uuidGenerator.get(); @@ -293,7 +293,7 @@ private Map> parseTestIdentifiers(KnownTestsD } LOGGER.debug("Received {} known tests in total", knownTestsCount); - metricCollector.add(CiVisibilityDistributionMetric.EFD_RESPONSE_TESTS, knownTestsCount); + metricCollector.add(CiVisibilityDistributionMetric.KNOWN_TESTS_RESPONSE_TESTS, knownTestsCount); return knownTestsCount > 0 ? testIdentifiers // returning null if there are no known tests: diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java index 8b592067bc8..a5b0cc5d4cd 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java @@ -132,9 +132,9 @@ public enum CiVisibilityCountMetric { */ ITR_FORCED_RUN("itr_forced_run", EventType.class), /** The number of requests sent to the known tests endpoint */ - EFD_REQUEST("known_tests.request", RequestCompressed.class), + KNOWN_TESTS_REQUEST("known_tests.request", RequestCompressed.class), /** The number of known tests requests sent to the known tests endpoint that errored */ - EFD_REQUEST_ERRORS("known_tests.request_errors", ErrorType.class, StatusCode.class), + KNOWN_TESTS_REQUEST_ERRORS("known_tests.request_errors", ErrorType.class, StatusCode.class), /** The number of requests sent to the flaky tests endpoint */ FLAKY_TESTS_REQUEST("flaky_tests.request", RequestCompressed.class), /** The number of tests requests sent to the flaky tests endpoint that errored */ diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java index 0153aeccedd..a7e7de917dc 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityDistributionMetric.java @@ -40,11 +40,11 @@ public enum CiVisibilityDistributionMetric { /** The number of files covered inside a coverage payload */ CODE_COVERAGE_FILES("code_coverage.files"), /* The time it takes to get the response of the known tests endpoint request in ms */ - EFD_REQUEST_MS("known_tests.request_ms"), + KNOWN_TESTS_REQUEST_MS("known_tests.request_ms"), /** The number of bytes received by the known tests endpoint */ - EFD_RESPONSE_BYTES("known_tests.response_bytes", ResponseCompressed.class), + KNOWN_TESTS_RESPONSE_BYTES("known_tests.response_bytes", ResponseCompressed.class), /** The number of tests received by the known tests endpoint */ - EFD_RESPONSE_TESTS("known_tests.response_tests"), + KNOWN_TESTS_RESPONSE_TESTS("known_tests.response_tests"), /** The time it takes to get the response of the flaky tests endpoint request in ms */ FLAKY_TESTS_REQUEST_MS("flaky_tests.request_ms"), /** The number of bytes received by the flaky tests endpoint */