diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestFrameworkModule.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestFrameworkModule.java index 3a5d64b3b28..5b7fc2b1de5 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestFrameworkModule.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestFrameworkModule.java @@ -31,6 +31,8 @@ TestSuiteImpl testSuiteStart( boolean isModified(TestSourceData testSourceData); + boolean isQuarantined(TestIdentifier test); + /** * Returns the reason for skipping a test, IF it can be skipped. * 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 65dcfbfa04d..aad4395aff6 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 @@ -18,8 +18,10 @@ import datadog.trace.api.civisibility.telemetry.TagValue; import datadog.trace.api.civisibility.telemetry.tag.BrowserDriver; import datadog.trace.api.civisibility.telemetry.tag.EventType; +import datadog.trace.api.civisibility.telemetry.tag.HasFailedAllRetries; import datadog.trace.api.civisibility.telemetry.tag.IsModified; import datadog.trace.api.civisibility.telemetry.tag.IsNew; +import datadog.trace.api.civisibility.telemetry.tag.IsQuarantined; import datadog.trace.api.civisibility.telemetry.tag.IsRetry; import datadog.trace.api.civisibility.telemetry.tag.IsRum; import datadog.trace.api.civisibility.telemetry.tag.SkipReason; @@ -190,6 +192,10 @@ public TestIdentifier getIdentifier() { return identifier; } + public boolean hasFailed() { + return span.isError(); + } + @Override public void setTag(String key, Object value) { span.setTag(key, value); @@ -265,13 +271,15 @@ public void end(@Nullable Long endTime) { Object retryReason = span.getTag(Tags.TEST_RETRY_REASON); metricCollector.add( - CiVisibilityCountMetric.EVENT_FINISHED, + CiVisibilityCountMetric.TEST_EVENT_FINISHED, 1, instrumentation, EventType.TEST, span.getTag(Tags.TEST_IS_NEW) != null ? IsNew.TRUE : null, span.getTag(Tags.TEST_IS_MODIFIED) != null ? IsModified.TRUE : null, + span.getTag(Tags.TEST_MANAGEMENT_IS_QUARANTINED) != null ? IsQuarantined.TRUE : null, span.getTag(Tags.TEST_IS_RETRY) != null ? IsRetry.TRUE : null, + span.getTag(Tags.TEST_HAS_FAILED_ALL_RETRIES) != null ? HasFailedAllRetries.TRUE : null, retryReason instanceof TagValue ? (TagValue) retryReason : null, span.getTag(Tags.TEST_IS_RUM_ACTIVE) != null ? IsRum.TRUE : null, CIConstants.SELENIUM_BROWSER_DRIVER.equals(span.getTag(Tags.TEST_BROWSER_DRIVER)) diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/ProxyTestModule.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/ProxyTestModule.java index 4d49b9b0423..17c6303756e 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/ProxyTestModule.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/ProxyTestModule.java @@ -103,6 +103,11 @@ public boolean isModified(TestSourceData testSourceData) { return executionStrategy.isModified(testSourceData); } + @Override + public boolean isQuarantined(TestIdentifier test) { + return executionStrategy.isQuarantined(test); + } + @Nullable @Override public SkipReason skipReason(TestIdentifier test) { diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java index 97687b3ca30..fa696149f21 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java @@ -88,6 +88,11 @@ public boolean isModified(TestSourceData testSourceData) { return executionStrategy.isModified(testSourceData); } + @Override + public boolean isQuarantined(TestIdentifier test) { + return executionStrategy.isQuarantined(test); + } + @Nullable @Override public SkipReason skipReason(TestIdentifier test) { 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 b2a73bcab16..fc8b4613b82 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 @@ -5,8 +5,8 @@ import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.events.TestEventsHandler; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; import datadog.trace.api.civisibility.telemetry.tag.SkipReason; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.bootstrap.ContextStore; @@ -58,8 +58,8 @@ public void onTestStart( @Nullable String testParameters, @Nullable Collection categories, @Nonnull TestSourceData testSourceData, - RetryReason retryReason, - @Nullable Long startTime) { + @Nullable Long startTime, + @Nullable TestExecutionHistory testExecutionHistory) { // do nothing } @@ -74,7 +74,8 @@ public void onTestFailure(TestKey descriptor, @Nullable Throwable throwable) { } @Override - public void onTestFinish(TestKey descriptor, @Nullable Long endTime) { + public void onTestFinish( + TestKey descriptor, @Nullable Long endTime, @Nullable TestExecutionHistory executionHistory) { // 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 bb040afd7e4..d5c9693e3dc 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 @@ -8,6 +8,7 @@ import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.events.TestEventsHandler; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; import datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric; import datadog.trace.api.civisibility.telemetry.CiVisibilityMetricCollector; @@ -139,8 +140,8 @@ public void onTestStart( final @Nullable String testParameters, final @Nullable Collection categories, final @Nonnull TestSourceData testSourceData, - final @Nullable RetryReason retryReason, - final @Nullable Long startTime) { + final @Nullable Long startTime, + final @Nullable TestExecutionHistory testExecutionHistory) { if (skipTrace(testSourceData.getTestClass())) { return; } @@ -166,6 +167,18 @@ public void onTestStart( test.setTag(Tags.TEST_IS_MODIFIED, true); } + if (testModule.isQuarantined(thisTest)) { + test.setTag(Tags.TEST_MANAGEMENT_IS_QUARANTINED, true); + } + + if (testExecutionHistory != null) { + RetryReason retryReason = testExecutionHistory.currentExecutionRetryReason(); + if (retryReason != null) { + test.setTag(Tags.TEST_IS_RETRY, true); + test.setTag(Tags.TEST_RETRY_REASON, retryReason); + } + } + if (testFramework != null) { test.setTag(Tags.TEST_FRAMEWORK, testFramework); if (testFrameworkVersion != null) { @@ -198,11 +211,6 @@ public void onTestStart( } } - if (retryReason != null) { - test.setTag(Tags.TEST_IS_RETRY, true); - test.setTag(Tags.TEST_RETRY_REASON, retryReason); - } - inProgressTests.put(descriptor, test); } @@ -227,12 +235,22 @@ public void onTestFailure(TestKey descriptor, @Nullable Throwable throwable) { } @Override - public void onTestFinish(TestKey descriptor, @Nullable Long endTime) { + public void onTestFinish( + TestKey descriptor, + @Nullable Long endTime, + @Nullable TestExecutionHistory testExecutionHistory) { TestImpl test = inProgressTests.remove(descriptor); if (test == null) { log.debug("Ignoring finish event, could not find test {}", descriptor); return; } + + if (testExecutionHistory != null) { + if (test.hasFailed() && testExecutionHistory.hasFailedAllRetries()) { + test.setTag(Tags.TEST_HAS_FAILED_ALL_RETRIES, true); + } + } + test.end(endTime); } @@ -259,7 +277,7 @@ public void onTestIgnore( null, null); onTestSkip(testDescriptor, reason); - onTestFinish(testDescriptor, null); + onTestFinish(testDescriptor, null, null); } @Override diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/Regular.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/Regular.java index 320170d7ba6..dbe8bc0dc3f 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/Regular.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/Regular.java @@ -31,4 +31,9 @@ public boolean retry(boolean successful, long durationMillis) { public RetryReason currentExecutionRetryReason() { return null; } + + @Override + public boolean hasFailedAllRetries() { + return false; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RetryUntilSuccessful.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RetryUntilSuccessful.java index 2a5463f4738..0bfe1220a75 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RetryUntilSuccessful.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RetryUntilSuccessful.java @@ -11,6 +11,7 @@ public class RetryUntilSuccessful implements TestExecutionPolicy { private final int maxExecutions; private final boolean suppressFailures; private int executions; + private boolean successfulExecutionSeen; /** Total execution counter that is shared by all retry policies */ private final AtomicInteger totalExecutions; @@ -25,22 +26,23 @@ public RetryUntilSuccessful( @Override public boolean applicable() { - return currentExecutionIsNotLast() || suppressFailures; + return !currentExecutionIsLast() || suppressFailures; } @Override public boolean suppressFailures() { // do not suppress failures for last execution // (unless flag to suppress all failures is set) - return currentExecutionIsNotLast() || suppressFailures; + return !currentExecutionIsLast() || suppressFailures; } - private boolean currentExecutionIsNotLast() { - return executions < maxExecutions - 1; + private boolean currentExecutionIsLast() { + return executions == maxExecutions - 1; } @Override public boolean retry(boolean successful, long durationMillis) { + successfulExecutionSeen |= successful; if (!successful && ++executions < maxExecutions) { totalExecutions.incrementAndGet(); return true; @@ -58,4 +60,9 @@ public RetryReason currentExecutionRetryReason() { private boolean currentExecutionIsRetry() { return executions > 0; } + + @Override + public boolean hasFailedAllRetries() { + return currentExecutionIsLast() && !successfulExecutionSeen; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunNTimes.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunNTimes.java index 79144f1d303..ac5fdd9d124 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunNTimes.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunNTimes.java @@ -12,6 +12,7 @@ public class RunNTimes implements TestExecutionPolicy { private final boolean suppressFailures; private int executions; private int maxExecutions; + private boolean successfulExecutionSeen; public RunNTimes( EarlyFlakeDetectionSettings earlyFlakeDetectionSettings, boolean suppressFailures) { @@ -23,11 +24,11 @@ public RunNTimes( @Override public boolean applicable() { - return currentExecutionIsNotLast() || suppressFailures(); + return !currentExecutionIsLast() || suppressFailures(); } - private boolean currentExecutionIsNotLast() { - return executions < maxExecutions - 1; + private boolean currentExecutionIsLast() { + return executions == maxExecutions - 1; } @Override @@ -37,6 +38,7 @@ public boolean suppressFailures() { @Override public boolean retry(boolean successful, long durationMillis) { + successfulExecutionSeen |= successful; // adjust maximum retries based on the now known test duration int maxExecutionsForGivenDuration = earlyFlakeDetectionSettings.getExecutions(durationMillis); maxExecutions = Math.min(maxExecutions, maxExecutionsForGivenDuration); @@ -52,4 +54,9 @@ public RetryReason currentExecutionRetryReason() { private boolean currentExecutionIsRetry() { return executions > 0; } + + @Override + public boolean hasFailedAllRetries() { + return currentExecutionIsLast() && !successfulExecutionSeen; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunOnceIgnoreOutcome.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunOnceIgnoreOutcome.java index 29edc8a3e02..44e1b2d3582 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunOnceIgnoreOutcome.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/execution/RunOnceIgnoreOutcome.java @@ -33,4 +33,9 @@ public boolean retry(boolean successful, long durationMillis) { public RetryReason currentExecutionRetryReason() { return null; } + + @Override + public boolean hasFailedAllRetries() { + return false; + } } 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 9d80fc40828..4de59bbef9b 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 @@ -4,7 +4,7 @@ import datadog.trace.api.civisibility.coverage.CoveragePerTestBridge; import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.bootstrap.ContextStore; import io.cucumber.core.gherkin.Pickle; @@ -29,13 +29,13 @@ public class CucumberTracingListener extends TracingListener { public static final String FRAMEWORK_NAME = "cucumber"; public static final String FRAMEWORK_VERSION = CucumberUtils.getVersion(); - private final ContextStore retryPolicies; + private final ContextStore executionHistories; private final Map pickleById; public CucumberTracingListener( - ContextStore retryPolicies, + ContextStore executionHistories, List> featureRunners) { - this.retryPolicies = retryPolicies; + this.executionHistories = executionHistories; pickleById = CucumberUtils.getPicklesById(featureRunners); } @@ -71,7 +71,6 @@ public void testStarted(final Description description) { String testName = CucumberUtils.getTestNameForScenario(description); List categories = getCategories(description); - TestExecutionPolicy retryPolicy = retryPolicies.get(description); TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestStart( new TestSuiteDescriptor(testSuiteName, null), CucumberUtils.toTestDescriptor(description), @@ -81,8 +80,8 @@ public void testStarted(final Description description) { null, categories, TestSourceData.UNKNOWN, - retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, - null); + null, + executionHistories.get(description)); recordFeatureFileCodeCoverage(description); } @@ -100,7 +99,9 @@ private static void recordFeatureFileCodeCoverage(Description scenarioDescriptio @Override public void testFinished(final Description description) { TestDescriptor testDescriptor = CucumberUtils.toTestDescriptor(description); - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestExecutionHistory executionHistory = executionHistories.get(description); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); } // same callback is executed both for test cases and test suites (for setup/teardown errors) diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/JUnit4CucumberInstrumentation.java b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/JUnit4CucumberInstrumentation.java index 6101c51f18c..5c9737b33a4 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/JUnit4CucumberInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/JUnit4CucumberInstrumentation.java @@ -7,7 +7,7 @@ import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.agent.tooling.muzzle.Reference; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.bootstrap.InstrumentationContext; import java.util.Collections; import java.util.List; @@ -46,7 +46,7 @@ public String[] helperClassNames() { @Override public Map contextStore() { return Collections.singletonMap( - "org.junit.runner.Description", TestExecutionPolicy.class.getName()); + "org.junit.runner.Description", TestExecutionHistory.class.getName()); } @Override @@ -84,7 +84,7 @@ public static void addTracingListener( replacedNotifier.addListener( new CucumberTracingListener( - InstrumentationContext.get(Description.class, TestExecutionPolicy.class), children)); + InstrumentationContext.get(Description.class, TestExecutionHistory.class), children)); runNotifier = replacedNotifier; } } diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/Cucumber4ExecutionInstrumentation.java b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/Cucumber4ExecutionInstrumentation.java index f7f673aa04d..7c169002193 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/Cucumber4ExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/Cucumber4ExecutionInstrumentation.java @@ -10,6 +10,7 @@ import datadog.trace.api.Config; import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.instrumentation.junit4.CucumberUtils; @@ -62,7 +63,7 @@ public String[] helperClassNames() { @Override public Map contextStore() { return Collections.singletonMap( - "org.junit.runner.Description", TestExecutionPolicy.class.getName()); + "org.junit.runner.Description", TestExecutionHistory.class.getName()); } @Override @@ -103,7 +104,7 @@ public static Boolean execute( return null; } - InstrumentationContext.get(Description.class, TestExecutionPolicy.class) + InstrumentationContext.get(Description.class, TestExecutionHistory.class) .put(description, executionPolicy); FailureSuppressingNotifier failureSuppressingNotifier = diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/groovy/CucumberTest.groovy b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/groovy/CucumberTest.groovy index 3a2b0804c36..7ab44abc90d 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/groovy/CucumberTest.groovy +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/groovy/CucumberTest.groovy @@ -98,8 +98,8 @@ class CucumberTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | features | quarantined - "test-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + testcaseName | features | quarantined + "test-quarantined-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) ] } @@ -117,10 +117,10 @@ class CucumberTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | features | quarantined | retried - "test-retry-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + testcaseName | features | quarantined | retried + "test-quarantined-failed-atr" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) - ] | [ + ] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) ] } @@ -138,15 +138,15 @@ class CucumberTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | features | quarantined | known - "test-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + testcaseName | features | quarantined | known + "test-quarantined-failed-known" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) - ] | [ + ] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) ] - "test-failed-efd" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + "test-quarantined-failed-efd" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) - ] | [] + ] | [] } private String version() { diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-atr/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-atr/coverages.ftl new file mode 100644 index 00000000000..aed9df93b31 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-atr/coverages.ftl @@ -0,0 +1,36 @@ +[ { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_2}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_3}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_4}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_5}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..f1393968ce4 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,343 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-4", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "junit.test_suite", + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "cucumber-junit-4", + "test.name" : "Addition", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "cucumber-junit-4", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "cucumber-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-4", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8} + }, + "name" : "junit.test_module", + "resource" : "cucumber-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-efd/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-efd/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 97% rename from dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-efd/events.ftl index ac77c4dec0f..fa19404348d 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -50,6 +50,7 @@ "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", "test.status" : "fail", @@ -98,6 +99,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", "test.retry_reason" : "efd", @@ -145,8 +147,10 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-known/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-known/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..ac1976f8ed8 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,148 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-4", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "junit.test_suite", + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "cucumber-junit-4", + "test.name" : "Addition", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "cucumber-junit-4", + "test.early_flake.enabled" : "true", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "cucumber-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-4", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "junit.test_module", + "resource" : "cucumber-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..e48f884bdbe --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1,8 @@ +[ { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed/events.ftl similarity index 99% rename from dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed/events.ftl rename to dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed/events.ftl index 64dc9c7e7e9..962da0e4e21 100644 --- a/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/cucumber-junit-4/src/test/resources/test-quarantined-failed/events.ftl @@ -49,6 +49,7 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", "test.status" : "fail", @@ -142,4 +143,4 @@ }, "type" : "test_module_end", "version" : 1 -} ] +} ] \ No newline at end of file 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 a28cbaf5b8a..e68e6daa057 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 @@ -239,6 +239,7 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Addition", 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 7499518a591..5d05ced5b68 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 @@ -325,6 +325,7 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "cucumber-junit-4", "test.name" : "Many additions", diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitInstrumentation.java b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitInstrumentation.java index 26329630dcd..04a7b05b9ba 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/MUnitInstrumentation.java @@ -6,7 +6,7 @@ import com.google.auto.service.AutoService; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.bootstrap.InstrumentationContext; import java.util.Collections; import java.util.List; @@ -44,7 +44,7 @@ public String[] helperClassNames() { @Override public Map contextStore() { return Collections.singletonMap( - "org.junit.runner.Description", TestExecutionPolicy.class.getName()); + "org.junit.runner.Description", TestExecutionHistory.class.getName()); } @Override @@ -75,7 +75,7 @@ public static void addTracingListener( replacedNotifier.addListener( new MUnitTracingListener( - InstrumentationContext.get(Description.class, TestExecutionPolicy.class))); + InstrumentationContext.get(Description.class, TestExecutionHistory.class))); runNotifier = replacedNotifier; } } 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 49a785d126c..56814b0a8b2 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 @@ -2,7 +2,7 @@ import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.instrumentation.api.AgentScope; @@ -23,10 +23,10 @@ public class MUnitTracingListener extends TracingListener { public static final String FRAMEWORK_NAME = "munit"; public static final String FRAMEWORK_VERSION = getVersion(); - private final ContextStore retryPolicies; + private final ContextStore executionHistories; - public MUnitTracingListener(ContextStore retryPolicies) { - this.retryPolicies = retryPolicies; + public MUnitTracingListener(ContextStore executionHistories) { + this.executionHistories = executionHistories; } public static String getVersion() { @@ -76,7 +76,6 @@ public void testStarted(final Description description) { TestDescriptor testDescriptor = MUnitUtils.toTestDescriptor(description); String testName = description.getMethodName(); List categories = getCategories(description); - TestExecutionPolicy retryPolicy = retryPolicies.get(description); TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestStart( suiteDescriptor, testDescriptor, @@ -86,14 +85,16 @@ public void testStarted(final Description description) { null, categories, JUnit4Utils.toTestSourceData(description), - retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, - null); + null, + executionHistories.get(description)); } @Override public void testFinished(final Description description) { TestDescriptor testDescriptor = MUnitUtils.toTestDescriptor(description); - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestExecutionHistory executionHistory = executionHistories.get(description); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); } // same callback is executed both for test cases and test suites (for setup/teardown errors) @@ -164,7 +165,7 @@ public void testIgnored(final Description description) { null); } TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSkip(testDescriptor, null); - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null, null); } else if (testClass != null) { TestSuiteDescriptor suiteDescriptor = MUnitUtils.toSuiteDescriptor(description); diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/MUnitExecutionInstrumentation.java b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/MUnitExecutionInstrumentation.java index 7d929694c75..0126950be92 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/MUnitExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/main/java/datadog/trace/instrumentation/junit4/execution/MUnitExecutionInstrumentation.java @@ -9,6 +9,7 @@ import datadog.trace.api.Config; import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.instrumentation.junit4.JUnit4Utils; @@ -62,7 +63,7 @@ public String[] helperClassNames() { @Override public Map contextStore() { return Collections.singletonMap( - "org.junit.runner.Description", TestExecutionPolicy.class.getName()); + "org.junit.runner.Description", TestExecutionHistory.class.getName()); } @Override @@ -97,7 +98,7 @@ public static Future apply( return null; } - InstrumentationContext.get(Description.class, TestExecutionPolicy.class) + InstrumentationContext.get(Description.class, TestExecutionHistory.class) .put(description, executionPolicy); Future result = Future.successful(false); diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/groovy/MUnitTest.groovy b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/groovy/MUnitTest.groovy index 0b4fbcb1a4f..ab757fcdd80 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/groovy/MUnitTest.groovy +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/groovy/MUnitTest.groovy @@ -88,8 +88,8 @@ class MUnitTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] } def "test quarantined auto-retries #testcaseName"() { @@ -105,8 +105,8 @@ class MUnitTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | retried - "test-retry-failed" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] } def "test quarantined early flakiness detection #testcaseName"() { @@ -122,9 +122,9 @@ class MUnitTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | known - "test-failed" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] - "test-failed-efd" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] | [] + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] + "test-quarantined-failed-efd" | [TestFailedMUnit] | [new TestIdentifier("org.example.TestFailedMUnit", "Calculator.add", null)] | [] } private void runTests(Collection> tests, boolean expectSuccess = true) { diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-atr/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-atr/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..04497596505 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,357 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "munit-junit-4", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "munit-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "munit-junit-4", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "munit-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "munit-junit-4", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedMUnit", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailedMUnit", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "munit-junit-4", + "test.name" : "Calculator.add", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedMUnit", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-efd/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-efd/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 97% rename from dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-efd/events.ftl index c5e94d96146..571e11423f8 100644 --- a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -123,6 +123,7 @@ "test.framework" : "munit", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", "test.source.file" : "dummy_source_path", @@ -173,6 +174,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", "test.retry_reason" : "efd", @@ -222,8 +224,10 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "munit", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-known/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-known/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..773f3cfd3f8 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,154 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "munit-junit-4", + "test.early_flake.enabled" : "true", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "munit-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "munit-junit-4", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "munit-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "munit-junit-4", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedMUnit", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailedMUnit", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "munit-junit-4", + "test.name" : "Calculator.add", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedMUnit", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..84feb9b6f22 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/munit-junit-4/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,152 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "munit-junit-4", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "munit-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "munit-junit-4", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "munit-junit-4", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "munit-junit-4", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedMUnit", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailedMUnit", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "munit.ComparisonFailException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "munit", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "munit-junit-4", + "test.name" : "Calculator.add", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedMUnit", + "test.traits" : "{\"category\":[\"myTag\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedMUnit.Calculator.add", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file 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 9824b20b206..ddd8c1d5e36 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 @@ -318,6 +318,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "munit", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "munit-junit-4", "test.name" : "Calculator.add", diff --git a/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Instrumentation.java b/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Instrumentation.java index 86671bf134e..abd72ed85b9 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Instrumentation.java +++ b/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Instrumentation.java @@ -9,7 +9,7 @@ import com.google.auto.service.AutoService; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.bootstrap.InstrumentationContext; import java.util.Collections; import java.util.List; @@ -75,7 +75,7 @@ public String[] helperClassNames() { @Override public Map contextStore() { return Collections.singletonMap( - "org.junit.runner.Description", TestExecutionPolicy.class.getName()); + "org.junit.runner.Description", TestExecutionHistory.class.getName()); } @Override @@ -116,7 +116,7 @@ public static void addTracingListener( final TracingListener tracingListener = new JUnit4TracingListener( - InstrumentationContext.get(Description.class, TestExecutionPolicy.class)); + InstrumentationContext.get(Description.class, TestExecutionHistory.class)); runNotifier.addListener(tracingListener); } 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 de0ecc306d0..db57d2af4f1 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 @@ -3,7 +3,7 @@ import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.bootstrap.ContextStore; import java.lang.reflect.Method; @@ -18,10 +18,10 @@ public class JUnit4TracingListener extends TracingListener { private static final String FRAMEWORK_NAME = "junit4"; private static final String FRAMEWORK_VERSION = Version.id(); - private final ContextStore retryPolicies; + private final ContextStore executionHistories; - public JUnit4TracingListener(ContextStore retryPolicies) { - this.retryPolicies = retryPolicies; + public JUnit4TracingListener(ContextStore executionHistories) { + this.executionHistories = executionHistories; } public void testSuiteStarted(final Description description) { @@ -74,7 +74,6 @@ public void testStarted(final Description description) { String testParameters = JUnit4Utils.getParameters(description); List categories = JUnit4Utils.getCategories(testSourceData.getTestClass(), testSourceData.getTestMethod()); - TestExecutionPolicy retryPolicy = retryPolicies.get(description); TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestStart( suiteDescriptor, @@ -85,8 +84,8 @@ public void testStarted(final Description description) { testParameters, categories, testSourceData, - retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, - null); + null, + executionHistories.get(description)); } @Override @@ -96,7 +95,9 @@ public void testFinished(final Description description) { } TestDescriptor testDescriptor = JUnit4Utils.toTestDescriptor(description); - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestExecutionHistory executionHistory = executionHistories.get(description); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); } // same callback is executed both for test cases and test suites (for setup/teardown errors) diff --git a/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/execution/JUnit4ExecutionInstrumentation.java b/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/execution/JUnit4ExecutionInstrumentation.java index 75ad0ca68ca..ad25f41a9f5 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/execution/JUnit4ExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/execution/JUnit4ExecutionInstrumentation.java @@ -10,6 +10,7 @@ import datadog.trace.api.Config; import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.instrumentation.junit4.JUnit4Utils; @@ -69,7 +70,7 @@ public String[] helperClassNames() { @Override public Map contextStore() { return Collections.singletonMap( - "org.junit.runner.Description", TestExecutionPolicy.class.getName()); + "org.junit.runner.Description", TestExecutionHistory.class.getName()); } @Override @@ -107,7 +108,7 @@ public static Boolean apply( return null; } - InstrumentationContext.get(Description.class, TestExecutionPolicy.class) + InstrumentationContext.get(Description.class, TestExecutionHistory.class) .put(description, executionPolicy); FailureSuppressingNotifier failureSuppressingNotifier = diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/groovy/JUnit4Test.groovy b/dd-java-agent/instrumentation/junit-4.10/src/test/groovy/JUnit4Test.groovy index fa27adcfab9..54d352f7156 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/groovy/JUnit4Test.groovy +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/groovy/JUnit4Test.groovy @@ -135,9 +135,9 @@ class JUnit4Test extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] - "test-failed-parameterized" | [TestFailedParameterized] | [new TestIdentifier("org.example.TestFailedParameterized", "test_failed_parameterized", null)] + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + "test-quarantined-failed-parameterized" | [TestFailedParameterized] | [new TestIdentifier("org.example.TestFailedParameterized", "test_failed_parameterized", null)] } def "test quarantined auto-retries #testcaseName"() { @@ -153,8 +153,8 @@ class JUnit4Test extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | retried - "test-retry-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] } def "test quarantined early flakiness detection #testcaseName"() { @@ -170,9 +170,9 @@ class JUnit4Test extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | known - "test-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] - "test-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [] + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + "test-quarantined-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [] } private void runTests(Collection> tests, boolean expectSuccess = true) { 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 6c81c7fb448..183ebd55f7e 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 @@ -373,6 +373,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "junit-4.10", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-atr/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-atr/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..01e9eb9ba7c --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,362 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "junit-4.10", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "junit-4.10", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-4.10", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "junit-4.10", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-4.10", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "junit-4.10", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-efd/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-efd/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 97% rename from dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-efd/events.ftl index b9bc04bc9ba..f1b6e55176f 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -122,6 +122,7 @@ "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", "test.source.file" : "dummy_source_path", @@ -173,6 +174,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", "test.retry_reason" : "efd", @@ -223,8 +225,10 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-known/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-known/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..837ccef8468 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,155 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "junit-4.10", + "test.early_flake.enabled" : "true", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "junit-4.10", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-4.10", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "junit-4.10", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-4.10", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "junit-4.10", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-quarantine/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate/src/test/resources/test-failed-quarantine/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-parameterized/events.ftl similarity index 98% rename from dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-parameterized/events.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-parameterized/events.ftl index 6ab10b0fb6f..2e1945b0a8b 100644 --- a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-failed-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed-parameterized/events.ftl @@ -120,6 +120,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_failed_parameterized[0 0 42]\"}}", @@ -168,6 +169,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"test_failed_parameterized[21 21 42]\"}}", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..743ea4e0b55 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-4.10/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,153 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "junit-4.10", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "junit-4.10", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-4.10", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "junit-4.10", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-4.10", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit4", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "junit-4.10", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file 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 d4d008f55a7..54ef0c228dc 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 @@ -321,6 +321,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed", 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 18c64db1fbd..e86722f0024 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 @@ -330,6 +330,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit4", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-4.10", "test.name" : "test_failed_parameterized", 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 904609e0f06..381de8066a7 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 @@ -3,6 +3,7 @@ import datadog.trace.api.Pair; import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.coverage.CoveragePerTestBridge; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import java.util.List; import java.util.stream.Collectors; @@ -123,8 +124,8 @@ private void testResourceExecutionStarted( null, tags, TestSourceData.UNKNOWN, - JUnitPlatformUtils.retryReason(testDescriptor), - null); + null, + TestEventsHandlerHolder.getExecutionHistory(testDescriptor)); CoveragePerTestBridge.recordCoverage(classpathResourceName); } @@ -148,7 +149,10 @@ private void testResourceExecutionFinished( TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFailure(testDescriptor, throwable); } } - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestExecutionHistory executionHistory = + TestEventsHandlerHolder.getExecutionHistory(testDescriptor); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); } @Override diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/groovy/CucumberTest.groovy b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/groovy/CucumberTest.groovy index 5f2f57f5bb3..b57a0a52b4c 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/groovy/CucumberTest.groovy +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/groovy/CucumberTest.groovy @@ -108,8 +108,8 @@ class CucumberTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | features | quarantined - "test-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + testcaseName | features | quarantined + "test-quarantined-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) ] } @@ -127,10 +127,10 @@ class CucumberTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | features | quarantined | retried - "test-retry-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + testcaseName | features | quarantined | retried + "test-quarantined-failed-atr" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) - ] | [ + ] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) ] } @@ -148,15 +148,15 @@ class CucumberTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | features | quarantined | known - "test-failed" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + testcaseName | features | quarantined | known + "test-quarantined-failed-known" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) - ] | [ + ] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) ] - "test-failed-efd" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ + "test-quarantined-failed-efd" | ["org/example/cucumber/calculator/basic_arithmetic_failed.feature"] | [ new TestIdentifier("classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", "Addition", null) - ] | [] + ] | [] } private String parameterizedTestNameSuffix() { 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 45e54ef7fc9..d6f9898d3e3 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 @@ -233,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-quarantined-failed-atr/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-atr/coverages.ftl new file mode 100644 index 00000000000..aed9df93b31 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-atr/coverages.ftl @@ -0,0 +1,36 @@ +[ { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_2}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_3}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_4}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id_5}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..d3b57289a18 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,343 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-5", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "junit.test_suite", + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "cucumber-junit-5", + "test.name" : "Addition", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "cucumber-junit-5", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "cucumber-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-5", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8} + }, + "name" : "junit.test_module", + "resource" : "cucumber-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "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-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-efd/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-efd/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 97% rename from dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-efd/events.ftl index 4acbe339494..0aae442aa7b 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -50,6 +50,7 @@ "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", "test.status" : "fail", @@ -98,6 +99,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", "test.retry_reason" : "efd", @@ -145,8 +147,10 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-known/coverages.ftl new file mode 100644 index 00000000000..e48f884bdbe --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-known/coverages.ftl @@ -0,0 +1,8 @@ +[ { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..f128c440822 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,148 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-5", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "junit.test_suite", + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "cucumber-junit-5", + "test.name" : "Addition", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "cucumber-junit-5", + "test.early_flake.enabled" : "true", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "cucumber-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-5", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "junit.test_module", + "resource" : "cucumber-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "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-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..e48f884bdbe --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1,8 @@ +[ { + "files" : [ { + "filename" : "org/example/cucumber/calculator/basic_arithmetic_failed.feature" + } ], + "span_id" : ${content_span_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..94bee36a5bd --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,146 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-5", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "junit.test_suite", + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "cucumber-junit-5", + "test.name" : "Addition", + "test.status" : "fail", + "test.suite" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "classpath:org/example/cucumber/calculator/basic_arithmetic_failed.feature:Basic Arithmetic.Addition", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "cucumber-junit-5", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "cucumber-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "cucumber", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "cucumber-junit-5", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "junit.test_module", + "resource" : "cucumber-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "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-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-5.4.0/events.ftl index 04cab3cde63..b1c40e20884 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-5.4.0/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-5.4.0/events.ftl @@ -239,6 +239,7 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1", diff --git a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-latest/events.ftl b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-latest/events.ftl index 4d5946a9922..6d2470d7706 100644 --- a/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-latest/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/cucumber-junit-5/src/test/resources/test-retry-failed-scenario-outline-latest/events.ftl @@ -239,6 +239,7 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Many additions.Single digits.Example #1.1", 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 bb58917bee1..b09a96c433a 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 @@ -239,6 +239,7 @@ "span.kind" : "test", "test.framework" : "cucumber", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "cucumber-junit-5", "test.name" : "Addition", 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 bd9b58841b7..449ee106326 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 @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.junit5; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import java.util.List; import java.util.stream.Collectors; @@ -124,8 +125,8 @@ private void testMethodExecutionStarted(TestDescriptor testDescriptor, MethodSou testParameters, tags, testSourceData, - JUnitPlatformUtils.retryReason(testDescriptor), - null); + null, + TestEventsHandlerHolder.getExecutionHistory(testDescriptor)); } private void testCaseExecutionFinished( @@ -147,7 +148,10 @@ private static void testMethodExecutionFinished( TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFailure(testDescriptor, throwable); } } - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestExecutionHistory executionHistory = + TestEventsHandlerHolder.getExecutionHistory(testDescriptor); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); } @Override diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5SpockParameterizedExecutionInstrumentation.java b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5SpockParameterizedExecutionInstrumentation.java similarity index 97% rename from dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5SpockParameterizedExecutionInstrumentation.java rename to dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5SpockParameterizedExecutionInstrumentation.java index 9074313fbed..a7642ad3259 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5SpockParameterizedExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5SpockParameterizedExecutionInstrumentation.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/retry/SpockParameterizedExecutionListener.java b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/execution/SpockParameterizedExecutionListener.java similarity index 96% rename from dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/retry/SpockParameterizedExecutionListener.java rename to dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/execution/SpockParameterizedExecutionListener.java index 813fb768e08..1fd3649a079 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/retry/SpockParameterizedExecutionListener.java +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/main/java/datadog/trace/instrumentation/junit5/execution/SpockParameterizedExecutionListener.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import datadog.trace.instrumentation.junit5.JUnitPlatformUtils; import java.util.Map; diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/groovy/SpockTest.groovy b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/groovy/SpockTest.groovy index e7ea2814d38..1f76fb7d93d 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/groovy/SpockTest.groovy +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/groovy/SpockTest.groovy @@ -38,7 +38,6 @@ class SpockTest extends CiVisibilityInstrumentationTest { @Override void configurePreAgent() { super.configurePreAgent() - givenTestsOrder(CIConstants.FAIL_FAST_TEST_ORDER) } def "test #testcaseName"() { @@ -142,9 +141,9 @@ class SpockTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] - "test-failed-parameterized" | [TestFailedParameterizedSpock] | [new TestIdentifier("org.example.TestFailedParameterizedSpock", "test add 4 and 4", null)] + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] + "test-quarantined-failed-parameterized" | [TestFailedParameterizedSpock] | [new TestIdentifier("org.example.TestFailedParameterizedSpock", "test add 4 and 4", null)] } def "test quarantined auto-retries #testcaseName"() { @@ -160,8 +159,8 @@ class SpockTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | retried - "test-retry-failed" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] } def "test quarantined early flakiness detection #testcaseName"() { @@ -177,9 +176,9 @@ class SpockTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | known - "test-failed" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] - "test-failed-efd" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] | [] + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] + "test-quarantined-failed-efd" | [TestFailedSpock] | [new TestIdentifier("org.example.TestFailedSpock", "test failed", null)] | [] } private static void runTests(List> classes, boolean expectSuccess = true) { 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 e49450e4e9f..53653b19bc6 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 @@ -206,6 +206,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", 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 a2d98f91db4..7a8a09d7455 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 @@ -54,7 +54,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", "test.source.file" : "dummy_source_path", @@ -105,7 +104,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", @@ -158,7 +156,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", @@ -208,7 +205,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed then succeed", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed/events.ftl index 139ab206207..84ce122f100 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed/events.ftl @@ -150,4 +150,4 @@ }, "type" : "test_module_end", "version" : 1 -} ] +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-parameterized-spec-setup/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-parameterized-spec-setup/events.ftl index 73d5bfb1432..3cc08985e18 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-parameterized-spec-setup/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-parameterized-spec-setup/events.ftl @@ -52,7 +52,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", @@ -104,7 +103,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-spec-setup/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-spec-setup/events.ftl index a01c50a6431..85ae2fefc79 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-spec-setup/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-not-skipping-spec-setup/events.ftl @@ -52,7 +52,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test another success", "test.source.file" : "dummy_source_path", @@ -101,7 +100,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", "test.skip_reason" : "Skipped by Datadog Intelligent Test Runner", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-parameterized/events.ftl index b4dedf00899..26294a20d35 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-parameterized/events.ftl @@ -52,7 +52,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", @@ -104,7 +103,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-spec-setup/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-spec-setup/events.ftl index 96bd7fc2b5a..87d0bcc6414 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-spec-setup/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping-spec-setup/events.ftl @@ -53,7 +53,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test another success", "test.skip_reason" : "Skipped by Datadog Intelligent Test Runner", @@ -104,7 +103,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", "test.skip_reason" : "Skipped by Datadog Intelligent Test Runner", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping/events.ftl index 8ee06f5da45..97962a20be1 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-skipping/events.ftl @@ -53,7 +53,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", "test.skip_reason" : "Skipped by Datadog Intelligent Test Runner", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable-suite/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable-suite/events.ftl index 9c2a86b0f44..97d2fe32a77 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable-suite/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable-suite/events.ftl @@ -52,7 +52,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.itr.forced_run" : "true", "test.itr.unskippable" : "true", "test.module" : "spock-junit-5", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable/events.ftl index c2aba94ac5d..ebfdb0327a2 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-itr-unskippable/events.ftl @@ -52,7 +52,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.itr.forced_run" : "true", "test.itr.unskippable" : "true", "test.module" : "spock-junit-5", 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 2918bcb57f2..f3e18f05367 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 @@ -54,7 +54,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", @@ -106,7 +105,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", @@ -157,7 +155,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", @@ -208,7 +205,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", @@ -306,4 +302,4 @@ }, "type" : "test_module_end", "version" : 1 -} ] +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-atr/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-atr/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..057e0af9afd --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,367 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "spock-junit-5", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailedSpock", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "spock-junit-5", + "test.name" : "test failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "spock-junit-5", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "spock-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "spock-junit-5", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8} + }, + "name" : "junit.test_module", + "resource" : "spock-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-efd/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-efd/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 98% rename from dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-efd/events.ftl index 7939af650fb..30fb242b205 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -55,6 +55,7 @@ "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", "test.source.file" : "dummy_source_path", @@ -107,6 +108,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", "test.retry_reason" : "efd", @@ -158,8 +160,10 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-known/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-known/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..10784161694 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,156 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "spock-junit-5", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailedSpock", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "spock-junit-5", + "test.name" : "test failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "spock-junit-5", + "test.early_flake.enabled" : "true", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "spock-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "spock-junit-5", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "junit.test_module", + "resource" : "spock-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-parameterized/events.ftl similarity index 99% rename from dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-parameterized/events.ftl rename to dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-parameterized/events.ftl index f680cdb5dbe..d09ffd910aa 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-failed-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed-parameterized/events.ftl @@ -51,7 +51,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", @@ -103,7 +102,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..cb3f8597871 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,154 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "spock-junit-5", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailedSpock", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.spockframework.runtime.SpockComparisonFailure", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "spock-junit-5", + "test.name" : "test failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedSpock", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedSpock.test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "spock-junit-5", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "spock-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "spock", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "spock-junit-5", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "junit.test_module", + "resource" : "spock-junit-5", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file 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 494677c86bb..6450f0ea8ae 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 @@ -54,7 +54,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", "test.source.file" : "dummy_source_path", @@ -105,7 +104,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", @@ -158,7 +156,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", @@ -211,7 +208,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", @@ -264,7 +260,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test failed", 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 2a2eee0b268..2339e2ab3b4 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 @@ -51,7 +51,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", @@ -103,7 +102,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", @@ -155,7 +153,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", @@ -209,7 +206,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", @@ -263,7 +259,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", @@ -317,7 +312,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-impacted/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-impacted/events.ftl index 547148c6398..f01c1e4810f 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-impacted/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-impacted/events.ftl @@ -52,7 +52,6 @@ "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_modified" : "true", - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", "test.source.file" : "dummy_source_path", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-parameterized/events.ftl index 9006f98e3c8..c7787bca513 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed-parameterized/events.ftl @@ -51,7 +51,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 1 and 2", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 1 and 2\"}}", @@ -100,7 +99,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test add 4 and 4", "test.parameters" : "{\"metadata\":{\"test_name\":\"test add 4 and 4\"}}", diff --git a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed/events.ftl index 61f59ffe49b..fc90e7755ee 100644 --- a/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/spock-junit-5/src/test/resources/test-succeed/events.ftl @@ -51,7 +51,6 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "spock", "test.framework_version" : ${content_meta_test_framework_version}, - "test.is_new" : "true", "test.module" : "spock-junit-5", "test.name" : "test success", "test.source.file" : "dummy_source_path", 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 db0e5215d43..ba9382c6f9f 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 @@ -4,7 +4,6 @@ import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; @@ -35,7 +34,6 @@ */ 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); @@ -186,11 +184,6 @@ public static boolean isParameterizedTest(TestDescriptor testDescriptor) { return "test-template".equals(lastSegment.getType()); } - public static RetryReason retryReason(TestDescriptor testDescriptor) { - String retryReasonSegment = getIDSegmentValue(testDescriptor, RETRY_DESCRIPTOR_REASON_SUFFIX); - return retryReasonSegment != null ? RetryReason.valueOf(retryReasonSegment) : null; - } - public static boolean isRetry(TestDescriptor testDescriptor) { return getIDSegmentValue(testDescriptor, RETRY_DESCRIPTOR_ID_SUFFIX) != null; } diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestEventsHandlerHolder.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestEventsHandlerHolder.java index 13f9f1b188a..cb209741bb1 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestEventsHandlerHolder.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestEventsHandlerHolder.java @@ -4,6 +4,7 @@ import datadog.trace.api.civisibility.DDTestSuite; import datadog.trace.api.civisibility.InstrumentationBridge; import datadog.trace.api.civisibility.events.TestEventsHandler; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.bootstrap.ContextStore; import datadog.trace.util.AgentThreadFactory; import org.junit.platform.engine.TestDescriptor; @@ -13,6 +14,8 @@ public abstract class TestEventsHandlerHolder { public static volatile TestEventsHandler TEST_EVENTS_HANDLER; private static ContextStore SUITE_STORE; private static ContextStore TEST_STORE; + private static volatile ContextStore + EXECUTION_HISTORY_STORE; static { Runtime.getRuntime() @@ -34,6 +37,28 @@ public static synchronized void setContextStores( } } + public static synchronized void setExecutionHistoryStore( + ContextStore executionHistoryStore) { + if (EXECUTION_HISTORY_STORE == null) { + EXECUTION_HISTORY_STORE = executionHistoryStore; + } + } + + public static void setExecutionHistory( + TestDescriptor testDescriptor, TestExecutionHistory history) { + if (EXECUTION_HISTORY_STORE != null) { + EXECUTION_HISTORY_STORE.put(testDescriptor, history); + } + } + + public static TestExecutionHistory getExecutionHistory(TestDescriptor testDescriptor) { + if (EXECUTION_HISTORY_STORE != null) { + return EXECUTION_HISTORY_STORE.get(testDescriptor); + } else { + return null; + } + } + public static synchronized void start() { if (TEST_EVENTS_HANDLER == null) { TEST_EVENTS_HANDLER = 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 77fbc39e13e..32874780b13 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 @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.junit5; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import java.util.List; import java.util.stream.Collectors; @@ -124,8 +125,8 @@ private void testMethodExecutionStarted(TestDescriptor testDescriptor, MethodSou testParameters, tags, testSourceData, - JUnitPlatformUtils.retryReason(testDescriptor), - null); + null, + TestEventsHandlerHolder.getExecutionHistory(testDescriptor)); } private void testCaseExecutionFinished( @@ -147,7 +148,10 @@ private static void testMethodExecutionFinished( TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFailure(testDescriptor, throwable); } } - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + TestExecutionHistory executionHistory = + TestEventsHandlerHolder.getExecutionHistory(testDescriptor); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); } @Override diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5ExecutionInstrumentation.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java similarity index 92% rename from dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5ExecutionInstrumentation.java rename to dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java index 5cf7a6b87a5..53bdd76a58f 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5ExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; @@ -15,7 +15,6 @@ import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; import datadog.trace.bootstrap.CallDepthThreadLocalMap; -import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.instrumentation.junit5.JUnitPlatformUtils; import datadog.trace.instrumentation.junit5.TestDataFactory; import datadog.trace.instrumentation.junit5.TestEventsHandlerHolder; @@ -67,13 +66,6 @@ public String[] helperClassNames() { }; } - @Override - public Map contextStore() { - return Collections.singletonMap( - "org.junit.platform.engine.TestDescriptor", - "datadog.trace.api.civisibility.execution.TestExecutionPolicy"); - } - @Override public ReferenceProvider runtimeMuzzleReferences() { return new TestTaskHandle.MuzzleHelper(); @@ -151,6 +143,8 @@ public static Boolean execute(@Advice.This HierarchicalTestExecutorService.TestT return null; } + TestEventsHandlerHolder.setExecutionHistory(testDescriptor, executionPolicy); + ThrowableCollectorFactoryWrapper factory = (ThrowableCollectorFactoryWrapper) taskHandle.getThrowableCollectorFactory(); EngineExecutionContext parentContext = taskHandle.getParentContext(); @@ -181,16 +175,15 @@ public static Boolean execute(@Advice.This HierarchicalTestExecutorService.TestT * require every test execution to have a distinct unique ID. * Rerunning a test with the ID that was executed previously will cause errors. */ - TestDescriptor retryDescriptor = - descriptorHandle.withIdSuffix( - JUnitPlatformUtils.RETRY_DESCRIPTOR_REASON_SUFFIX, - executionPolicy.currentExecutionRetryReason(), + Map suffix = + Collections.singletonMap( JUnitPlatformUtils.RETRY_DESCRIPTOR_ID_SUFFIX, String.valueOf(++retryAttemptIdx)); + + TestDescriptor retryDescriptor = descriptorHandle.withIdSuffix(suffix); taskHandle.setTestDescriptor(retryDescriptor); taskHandle.setNode((Node) retryDescriptor); taskHandle.getListener().dynamicTestRegistered(retryDescriptor); - InstrumentationContext.get(TestDescriptor.class, TestExecutionPolicy.class) - .put(retryDescriptor, executionPolicy); + TestEventsHandlerHolder.setExecutionHistory(retryDescriptor, executionPolicy); // restore parent context, since the reference is overwritten with null after execution taskHandle.setParentContext(parentContext); diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionStoreInstrumentation.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionStoreInstrumentation.java new file mode 100644 index 00000000000..99d7e294b7c --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionStoreInstrumentation.java @@ -0,0 +1,91 @@ +package datadog.trace.instrumentation.junit5.execution; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.not; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.instrumentation.junit5.JUnitPlatformUtils; +import datadog.trace.instrumentation.junit5.TestEventsHandlerHolder; +import datadog.trace.util.Strings; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.util.Collections; +import java.util.Map; +import net.bytebuddy.asm.Advice; +import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService; + +@AutoService(InstrumenterModule.class) +public class JUnit5ExecutionStoreInstrumentation extends InstrumenterModule.CiVisibility + implements Instrumenter.ForTypeHierarchy, Instrumenter.HasMethodAdvice { + + private final String parentPackageName = + Strings.getPackageName(JUnitPlatformUtils.class.getName()); + + public JUnit5ExecutionStoreInstrumentation() { + super("ci-visibility", "junit-5", "test-retry"); + } + + @Override + public String hierarchyMarkerType() { + return "org.junit.platform.engine.TestEngine"; + } + + @Override + public ElementMatcher hierarchyMatcher() { + return implementsInterface(named(hierarchyMarkerType())) + // JUnit 4 has a dedicated instrumentation + .and(not(named("org.junit.vintage.engine.VintageTestEngine"))) + // suites are only used to organize other test engines + .and(not(named("org.junit.platform.suite.engine.SuiteTestEngine"))); + } + + @Override + public String[] helperClassNames() { + return new String[] { + parentPackageName + ".TestEventsHandlerHolder", + }; + } + + @Override + public Map contextStore() { + return Collections.singletonMap( + "org.junit.platform.engine.TestDescriptor", + "datadog.trace.api.civisibility.execution.TestExecutionHistory"); + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("discover") + .and( + takesArgument(0, named("org.junit.platform.engine.EngineDiscoveryRequest")) + .and(takesArgument(1, named("org.junit.platform.engine.UniqueId")))), + JUnit5ExecutionStoreInstrumentation.class.getName() + "$ContextStoreAdvice"); + } + + public static class ContextStoreAdvice { + @SuppressFBWarnings( + value = "UC_USELESS_OBJECT", + justification = "executionRequest is the argument of the original method") + @Advice.OnMethodEnter + public static void setContextStores() { + ContextStore contextStore = + InstrumentationContext.get(TestDescriptor.class, TestExecutionHistory.class); + TestEventsHandlerHolder.setExecutionHistoryStore(contextStore); + } + + // JUnit 5.3.0 and above + public static void muzzleCheck(final SameThreadHierarchicalTestExecutorService service) { + service.invokeAll(null); + } + } +} diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5NodeTestTaskContextInstrumentation.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5NodeTestTaskContextInstrumentation.java similarity index 97% rename from dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5NodeTestTaskContextInstrumentation.java rename to dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5NodeTestTaskContextInstrumentation.java index 2525ba73829..73b0e41fe51 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/JUnit5NodeTestTaskContextInstrumentation.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5NodeTestTaskContextInstrumentation.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; 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/execution/TestDescriptorHandle.java similarity index 81% rename from dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestDescriptorHandle.java rename to dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestDescriptorHandle.java index e433f8633ba..b89fc1113e4 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/execution/TestDescriptorHandle.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import datadog.trace.agent.tooling.muzzle.Reference; import datadog.trace.util.MethodHandles; @@ -6,6 +6,7 @@ import java.lang.invoke.MethodHandle; import java.util.Collection; import java.util.Collections; +import java.util.Map; import org.junit.platform.commons.util.ClassLoaderUtils; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.UniqueId; @@ -42,13 +43,12 @@ public TestDescriptorHandle(TestDescriptor testDescriptor) { this.testDescriptor = UnsafeUtils.tryShallowClone(testDescriptor); } - public TestDescriptor withIdSuffix( - String segmentName, Object segmentValue, String otherSegmentName, Object otherSegmentValue) { - UniqueId uniqueId = testDescriptor.getUniqueId(); - UniqueId updatedId = - uniqueId - .append(segmentName, String.valueOf(segmentValue)) - .append(otherSegmentName, String.valueOf(otherSegmentValue)); + public TestDescriptor withIdSuffix(Map suffices) { + UniqueId updatedId = testDescriptor.getUniqueId(); + for (Map.Entry e : suffices.entrySet()) { + updatedId = updatedId.append(e.getKey(), String.valueOf(e.getValue())); + } + TestDescriptor descriptorClone = UnsafeUtils.tryShallowClone(testDescriptor); METHOD_HANDLES.invoke(UNIQUE_ID_SETTER, descriptorClone, updatedId); return descriptorClone; diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestTaskHandle.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java similarity index 99% rename from dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestTaskHandle.java rename to dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java index 802c4354d13..af50a2aef5b 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/TestTaskHandle.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import datadog.trace.agent.tooling.muzzle.Reference; import datadog.trace.agent.tooling.muzzle.ReferenceProvider; diff --git a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/ThrowableCollectorFactoryWrapper.java b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/ThrowableCollectorFactoryWrapper.java similarity index 95% rename from dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/ThrowableCollectorFactoryWrapper.java rename to dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/ThrowableCollectorFactoryWrapper.java index 6a5074ccefa..f9f0dc23c17 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/retry/ThrowableCollectorFactoryWrapper.java +++ b/dd-java-agent/instrumentation/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/ThrowableCollectorFactoryWrapper.java @@ -1,4 +1,4 @@ -package datadog.trace.instrumentation.junit5.retry; +package datadog.trace.instrumentation.junit5.execution; import org.junit.platform.engine.support.hierarchical.ThrowableCollector; diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/groovy/JUnit5Test.groovy b/dd-java-agent/instrumentation/junit-5.3/src/test/groovy/JUnit5Test.groovy index c4257650728..49225c3547b 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/groovy/JUnit5Test.groovy +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/groovy/JUnit5Test.groovy @@ -173,9 +173,9 @@ class JUnit5Test extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] - "test-failed-parameterized" | [TestFailedParameterized] | [new TestIdentifier("org.example.TestFailedParameterized", "test_failed_parameterized", null)] + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + "test-quarantined-failed-parameterized" | [TestFailedParameterized] | [new TestIdentifier("org.example.TestFailedParameterized", "test_failed_parameterized", null)] } def "test quarantined auto-retries #testcaseName"() { @@ -191,8 +191,8 @@ class JUnit5Test extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | retried - "test-retry-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] } def "test quarantined early flakiness detection #testcaseName"() { @@ -208,9 +208,9 @@ class JUnit5Test extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | known - "test-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] - "test-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [] + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + "test-quarantined-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [] } protected void runTests(List> tests, boolean expectSuccess = true) { 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 4ff48b32614..f79c95d1faa 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 @@ -376,6 +376,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", "test.module" : "junit-5.3", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-atr/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-atr/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-atr/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..4283b62ced7 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,367 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "junit-5.3", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "junit-5.3", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-5.3", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "junit-5.3", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-5.3", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "junit-5.3", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-efd/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-efd/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 98% rename from dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-efd/events.ftl index 78b17e5d2a8..ee69490a5cc 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -123,6 +123,7 @@ "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", "test.source.file" : "dummy_source_path", @@ -175,6 +176,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", "test.retry_reason" : "efd", @@ -226,8 +228,10 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-known/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-known/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..0681acfab8d --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,156 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "junit-5.3", + "test.early_flake.enabled" : "true", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "junit-5.3", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-5.3", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "junit-5.3", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-5.3", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "junit-5.3", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-parameterized/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-parameterized/events.ftl similarity index 98% rename from dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-parameterized/events.ftl rename to dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-parameterized/events.ftl index 1dfdad89f47..dc422d1d12a 100644 --- a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-failed-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed-parameterized/events.ftl @@ -120,6 +120,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[1] 0, 0, 42\"}}", @@ -171,6 +172,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", "test.parameters" : "{\"metadata\":{\"test_name\":\"[2] 1, 1, 42\"}}", diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..6ba32d8dccb --- /dev/null +++ b/dd-java-agent/instrumentation/junit-5.3/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,154 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "junit-5.3", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "junit.test_session", + "resource" : "junit-5.3", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-5.3", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "junit.test_module", + "resource" : "junit-5.3", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "junit-5.3", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "junit", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.opentest4j.AssertionFailedError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "junit5", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "junit-5.3", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "junit.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +} ] \ No newline at end of file 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 1163e899b00..37f65270bfb 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 @@ -373,6 +373,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_factory", 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 b789fefc1bf..853997bd35d 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 @@ -326,6 +326,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed", 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 5aa58f2784b..8abc10811e6 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 @@ -330,6 +330,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", @@ -593,6 +594,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_failed_parameterized", 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 6a1200c7863..8f0e91f9c67 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 @@ -330,6 +330,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "junit5", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "junit-5.3", "test.name" : "test_template", diff --git a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java index b7386e7a673..6f02d49d039 100644 --- a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java @@ -104,8 +104,7 @@ public static void afterExecute(@Advice.This ScenarioRuntime scenarioRuntime) { while (executionPolicy.retry(!context.getAndResetFailed(), duration)) { ScenarioRuntime retry = new ScenarioRuntime(scenarioRuntime.featureRuntime, scenarioRuntime.scenario); - retry.magicVariables.put( - KarateUtils.RETRY_MAGIC_VARIABLE, executionPolicy.currentExecutionRetryReason()); + retry.magicVariables.put(KarateUtils.EXECUTION_HISTORY_MAGICVARIABLE, executionPolicy); retry.run(); retry.featureRuntime.result.addResult(retry.result); finalResult = 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 7be682983c7..475fc0f9166 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 @@ -19,7 +19,7 @@ import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.SkipReason; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.bootstrap.ContextStore; @@ -144,8 +144,8 @@ public boolean beforeScenario(ScenarioRuntime sr) { parameters, categories, TestSourceData.UNKNOWN, - (RetryReason) sr.magicVariables.get(KarateUtils.RETRY_MAGIC_VARIABLE), - null); + null, + (TestExecutionHistory) sr.magicVariables.get(KarateUtils.EXECUTION_HISTORY_MAGICVARIABLE)); return true; } @@ -162,7 +162,11 @@ public void afterScenario(ScenarioRuntime sr) { } else if (result.getStepResults().isEmpty()) { TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSkip(testDescriptor, null); } - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, null); + + TestExecutionHistory executionHistory = + (TestExecutionHistory) sr.magicVariables.get(KarateUtils.EXECUTION_HISTORY_MAGICVARIABLE); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionHistory); Boolean runHooksManually = manualFeatureHooks.remove(sr.featureRuntime); if (runHooksManually != null && runHooksManually) { diff --git a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java index b93213b0cb1..d96697a2c63 100644 --- a/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java +++ b/dd-java-agent/instrumentation/karate/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java @@ -21,7 +21,7 @@ public abstract class KarateUtils { - public static final String RETRY_MAGIC_VARIABLE = "__datadog_retry"; + public static final String EXECUTION_HISTORY_MAGICVARIABLE = "__datadog_execution_history"; private KarateUtils() {} diff --git a/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy b/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy index 4f3b72c4657..3a866bd64e8 100644 --- a/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy +++ b/dd-java-agent/instrumentation/karate/src/test/groovy/KarateTest.groovy @@ -104,8 +104,8 @@ class KarateTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed-quarantine" | [TestFailedKarate] | [new TestIdentifier("[org/example/test_failed] test failed", "second scenario", null)] + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailedKarate] | [new TestIdentifier("[org/example/test_failed] test failed", "second scenario", null)] } private void runTests(List> tests, boolean expectSuccess = true) { diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-quarantine/events.ftl b/dd-java-agent/instrumentation/karate/src/test/resources/test-quarantined-failed/events.ftl similarity index 99% rename from dd-java-agent/instrumentation/karate/src/test/resources/test-failed-quarantine/events.ftl rename to dd-java-agent/instrumentation/karate/src/test/resources/test-quarantined-failed/events.ftl index 869575044b3..2440c78cd2c 100644 --- a/dd-java-agent/instrumentation/karate/src/test/resources/test-failed-quarantine/events.ftl +++ b/dd-java-agent/instrumentation/karate/src/test/resources/test-quarantined-failed/events.ftl @@ -139,6 +139,7 @@ "span.kind" : "test", "test.framework" : "karate", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "karate", "test.name" : "second scenario", "test.status" : "fail", 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 121cd6320ea..302be4e62e9 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 @@ -424,6 +424,7 @@ "span.kind" : "test", "test.framework" : "karate", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "karate", "test.name" : "second scenario", 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 c895f305e1b..496351474e7 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 @@ -674,6 +674,7 @@ "span.kind" : "test", "test.framework" : "karate", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "karate", "test.name" : "first scenario as an outline", 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 079cfee63b8..b6db8da856c 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 @@ -6,7 +6,7 @@ import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestEventsHandler; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.SkipReason; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.instrumentation.scalatest.execution.SuppressedTestFailedException; @@ -145,7 +145,6 @@ private static void onTestStart(TestStarting event) { categories = Collections.emptyList(); } Class testClass = ScalatestUtils.getClass(event.suiteClassName()); - TestExecutionPolicy retryPolicy = context.popExecutionPolicy(testIdentifier); eventHandler.onTestStart( new TestSuiteDescriptor(testSuiteName, testClass), @@ -156,8 +155,8 @@ private static void onTestStart(TestStarting event) { testParameters, categories, new TestSourceData(testClass, null, null), - retryPolicy != null ? retryPolicy.currentExecutionRetryReason() : null, - null); + null, + context.getExecutionHistory(testIdentifier)); } private static void onTestSuccess(TestSucceeded event) { @@ -172,7 +171,11 @@ private static void onTestSuccess(TestSucceeded event) { String testParameters = null; TestDescriptor testDescriptor = new TestDescriptor(testSuiteName, testClass, testName, testParameters, testQualifier); - eventHandler.onTestFinish(testDescriptor, null); + + TestIdentifier testIdentifier = new TestIdentifier(testSuiteName, testName, null); + TestExecutionHistory executionHistory = context.popExecutionHistory(testIdentifier); + + eventHandler.onTestFinish(testDescriptor, null, executionHistory); } private static void onTestFailure(TestFailed event) { @@ -188,8 +191,12 @@ private static void onTestFailure(TestFailed event) { Throwable throwable = event.throwable().getOrElse(null); TestDescriptor testDescriptor = new TestDescriptor(testSuiteName, testClass, testName, testParameters, testQualifier); + + TestIdentifier testIdentifier = new TestIdentifier(testSuiteName, testName, null); + TestExecutionHistory executionHistory = context.popExecutionHistory(testIdentifier); + eventHandler.onTestFailure(testDescriptor, throwable); - eventHandler.onTestFinish(testDescriptor, null); + eventHandler.onTestFinish(testDescriptor, null, executionHistory); } private static void onTestIgnore(TestIgnored event) { @@ -239,7 +246,11 @@ private static void onTestCancel(TestCanceled event) { } else { eventHandler.onTestSkip(testDescriptor, reason); } - eventHandler.onTestFinish(testDescriptor, null); + + TestIdentifier testIdentifier = new TestIdentifier(testSuiteName, testName, null); + TestExecutionHistory executionHistory = context.popExecutionHistory(testIdentifier); + + eventHandler.onTestFinish(testDescriptor, null, executionHistory); } private static void onTestPending(TestPending event) { @@ -257,6 +268,10 @@ private static void onTestPending(TestPending event) { TestDescriptor testDescriptor = new TestDescriptor(testSuiteName, testClass, testName, testParameters, testQualifier); eventHandler.onTestSkip(testDescriptor, reason); - eventHandler.onTestFinish(testDescriptor, null); + + TestIdentifier testIdentifier = new TestIdentifier(testSuiteName, testName, null); + TestExecutionHistory executionHistory = context.popExecutionHistory(testIdentifier); + + eventHandler.onTestFinish(testDescriptor, null, executionHistory); } } diff --git a/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/RunContext.java b/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/RunContext.java index bce38d35c10..9d67dc38699 100644 --- a/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/RunContext.java +++ b/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/RunContext.java @@ -6,6 +6,7 @@ import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestEventsHandler; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; import datadog.trace.api.civisibility.telemetry.tag.SkipReason; import java.util.ArrayList; @@ -128,14 +129,19 @@ private boolean isItrUnskippable(TestIdentifier test, Map> t return testTags != null && testTags.contains(InstrumentationBridge.ITR_UNSKIPPABLE_TAG); } - public TestExecutionPolicy executionPolicy( + public TestExecutionPolicy getOrCreateExecutionPolicy( TestIdentifier testIdentifier, TestSourceData testSourceData) { return executionPolicies.computeIfAbsent( testIdentifier, test -> eventHandler.executionPolicy(test, testSourceData)); } @Nullable - public TestExecutionPolicy popExecutionPolicy(TestIdentifier testIdentifier) { + public TestExecutionHistory getExecutionHistory(TestIdentifier testIdentifier) { + return executionPolicies.get(testIdentifier); + } + + @Nullable + public TestExecutionHistory popExecutionHistory(TestIdentifier testIdentifier) { TestExecutionPolicy[] holder = new TestExecutionPolicy[1]; executionPolicies.computeIfPresent( testIdentifier, diff --git a/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/execution/ScalatestExecutionInstrumentation.java b/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/execution/ScalatestExecutionInstrumentation.java index a006bf757d0..dc054666c9c 100644 --- a/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/execution/ScalatestExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/scalatest/src/main/java/datadog/trace/instrumentation/scalatest/execution/ScalatestExecutionInstrumentation.java @@ -87,7 +87,7 @@ public static void beforeTest( TestIdentifier testIdentifier = new TestIdentifier(suite.suiteId(), testName, null); TestSourceData testSourceData = new TestSourceData(suite.getClass(), null, null); TestExecutionPolicy executionPolicy = - context.executionPolicy(testIdentifier, testSourceData); + context.getOrCreateExecutionPolicy(testIdentifier, testSourceData); invokeWithFixture = new TestExecutionWrapper(invokeWithFixture, executionPolicy); } diff --git a/dd-java-agent/instrumentation/scalatest/src/test/groovy/ScalatestTest.groovy b/dd-java-agent/instrumentation/scalatest/src/test/groovy/ScalatestTest.groovy index 43741eaf554..35f68295a2b 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/groovy/ScalatestTest.groovy +++ b/dd-java-agent/instrumentation/scalatest/src/test/groovy/ScalatestTest.groovy @@ -110,8 +110,8 @@ class ScalatestTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] } def "test quarantined auto-retries #testcaseName"() { @@ -127,8 +127,8 @@ class ScalatestTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | retried - "test-retry-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] } def "test quarantined early flakiness detection #testcaseName"() { @@ -144,9 +144,9 @@ class ScalatestTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | known - "test-failed" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] - "test-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] | [] + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] + "test-quarantined-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "Example.add adds two numbers", null)] | [] } @Override diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-atr/coverages.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-atr/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-atr/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..6349dc54035 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,352 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "scalatest", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "scalatest.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "scalatest", + "test.name" : "Example.add adds two numbers", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "scalatest", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test_session", + "resource" : "scalatest", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "scalatest", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8} + }, + "name" : "scalatest.test_module", + "resource" : "scalatest", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-efd/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-efd/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 97% rename from dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-efd/events.ftl index aba4496f09d..d41a5052157 100644 --- a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -55,6 +55,7 @@ "test.framework" : "scalatest", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", "test.source.file" : "dummy_source_path", @@ -104,6 +105,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", "test.retry_reason" : "efd", @@ -152,8 +154,10 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "scalatest", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-known/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-known/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..b58aa206350 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,153 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "scalatest", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "scalatest.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "scalatest", + "test.name" : "Example.add adds two numbers", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "scalatest", + "test.early_flake.enabled" : "true", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test_session", + "resource" : "scalatest", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "scalatest", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "scalatest.test_module", + "resource" : "scalatest", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..14dd8e63817 --- /dev/null +++ b/dd-java-agent/instrumentation/scalatest/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,151 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "scalatest", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "scalatest.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.scalatest.exceptions.TestFailedException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "scalatest", + "test.name" : "Example.add adds two numbers", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.Example.add adds two numbers", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "scalatest", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "scalatest.test_session", + "resource" : "scalatest", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "scalatest", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "scalatest", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "scalatest", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "scalatest.test_module", + "resource" : "scalatest", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file 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 d9499753bd7..e91b82add17 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 @@ -248,6 +248,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "scalatest", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "Example.add adds two numbers", 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 895acec8f46..b4b7632dac7 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 @@ -248,6 +248,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "scalatest", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "scalatest", "test.name" : "addition should correctly add two numbers", 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 6237acd9ddd..6b131b2f250 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 @@ -2,10 +2,11 @@ import datadog.trace.api.civisibility.config.TestSourceData; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.instrumentation.testng.execution.RetryAnalyzer; import java.util.List; +import javax.annotation.Nullable; import org.testng.IConfigurationListener; import org.testng.IRetryAnalyzer; import org.testng.ITestClass; @@ -91,29 +92,32 @@ public void onTestStart(final ITestResult result) { testParameters, groups, testSourceData, - retryReason(result), - null); + null, + executionHistory(result)); } - private RetryReason retryReason(final ITestResult result) { + @Nullable + private TestExecutionHistory executionHistory(final ITestResult result) { IRetryAnalyzer retryAnalyzer = TestNGUtils.getRetryAnalyzer(result); if (retryAnalyzer instanceof RetryAnalyzer) { RetryAnalyzer datadogAnalyzer = (RetryAnalyzer) retryAnalyzer; - return datadogAnalyzer.currentExecutionRetryReason(); + return datadogAnalyzer.getExecutionHistory(); } return null; } @Override public void onTestSuccess(final ITestResult result) { - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(result, null); + TestExecutionHistory executionHistory = executionHistory(result); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(result, null, executionHistory); } @Override public void onTestFailure(final ITestResult result) { Throwable throwable = result.getThrowable(); + TestExecutionHistory executionHistory = executionHistory(result); TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFailure(result, throwable); - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(result, null); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(result, null, executionHistory); } @Override @@ -135,6 +139,7 @@ public void onTestSkipped(final ITestResult result) { String reason = throwable != null ? throwable.getMessage() : null; TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSkip(result, reason); } - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(result, null); + TestExecutionHistory executionHistory = executionHistory(result); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish(result, null, executionHistory); } } diff --git a/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/execution/RetryAnalyzer.java b/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/execution/RetryAnalyzer.java index 9d9604e0363..1fa64bbfb41 100644 --- a/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/execution/RetryAnalyzer.java +++ b/dd-java-agent/instrumentation/testng/src/main/java/datadog/trace/instrumentation/testng/execution/RetryAnalyzer.java @@ -2,8 +2,8 @@ import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; import datadog.trace.instrumentation.testng.TestEventsHandlerHolder; import datadog.trace.instrumentation.testng.TestNGUtils; import org.testng.IRetryAnalyzer; @@ -33,8 +33,8 @@ public boolean retry(ITestResult result) { result.isSuccess(), result.getEndMillis() - result.getStartMillis()); } - public RetryReason currentExecutionRetryReason() { - return executionPolicy != null ? executionPolicy.currentExecutionRetryReason() : null; + public TestExecutionHistory getExecutionHistory() { + return executionPolicy; } public boolean suppressFailures() { diff --git a/dd-java-agent/instrumentation/testng/src/testFixtures/groovy/datadog/trace/instrumentation/testng/TestNGTest.groovy b/dd-java-agent/instrumentation/testng/src/testFixtures/groovy/datadog/trace/instrumentation/testng/TestNGTest.groovy index f7a4ca4f3d1..29168c66838 100644 --- a/dd-java-agent/instrumentation/testng/src/testFixtures/groovy/datadog/trace/instrumentation/testng/TestNGTest.groovy +++ b/dd-java-agent/instrumentation/testng/src/testFixtures/groovy/datadog/trace/instrumentation/testng/TestNGTest.groovy @@ -165,9 +165,9 @@ abstract class TestNGTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined - "test-failed-${version()}" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] - "test-failed-parameterized" | [TestFailedParameterized] | [new TestIdentifier("org.example.TestFailedParameterized", "parameterized_test_succeed", null)] + testcaseName | tests | quarantined + "test-quarantined-failed-${version()}" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + "test-quarantined-failed-parameterized" | [TestFailedParameterized] | [new TestIdentifier("org.example.TestFailedParameterized", "parameterized_test_succeed", null)] } def "test quarantined auto-retries #testcaseName"() { @@ -185,8 +185,8 @@ abstract class TestNGTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | retried - "test-retry-failed-${version()}" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr-${version()}" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] } def "test quarantined early flakiness detection #testcaseName"() { @@ -204,9 +204,9 @@ abstract class TestNGTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | quarantined | known - "test-failed-${version()}" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] - "test-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [] + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] + "test-quarantined-failed-efd" | [TestFailed] | [new TestIdentifier("org.example.TestFailed", "test_failed", null)] | [] } private static boolean isEFDSupported() { diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-faulty-session-threshold/events.ftl index 83867ec017a..146b1462b1d 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-faulty-session-threshold/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -1,438 +1,461 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestFailedAndSucceed", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "fail", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestFailedAndSucceed", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedAndSucceed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestFailedAndSucceed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 1, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_another_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_another_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_another_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_another_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_2}, - "span_id" : ${content_span_id_2}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", - "start" : ${content_start_3}, - "duration" : ${content_duration_3}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_another_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_another_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_another_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_3}, - "span_id" : ${content_span_id_3}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", - "start" : ${content_start_4}, - "duration" : ${content_duration_4}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_another_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_another_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "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", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_4}, - "span_id" : ${content_span_id_4}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_failed", - "start" : ${content_start_5}, - "duration" : ${content_duration_5}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_failed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_failed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "error.type" : "java.lang.AssertionError", - "_dd.profiling.ctx" : "test", - "error.message" : ${content_meta_error_message}, - "error.stack" : ${content_meta_error_stack}, - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_5}, - "span_id" : ${content_span_id_5}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_failed", - "start" : ${content_start_6}, - "duration" : ${content_duration_6}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_failed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_failed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "error.type" : "java.lang.AssertionError", - "_dd.profiling.ctx" : "test", - "error.message" : ${content_meta_error_message}, - "error.stack" : ${content_meta_error_stack_2}, - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_6}, - "span_id" : ${content_span_id_6}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_failed", - "start" : ${content_start_7}, - "duration" : ${content_duration_7}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_failed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_failed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "error.type" : "java.lang.AssertionError", - "_dd.profiling.ctx" : "test", - "error.message" : ${content_meta_error_message}, - "error.stack" : ${content_meta_error_stack_3}, - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_7}, - "span_id" : ${content_span_id_7}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_succeed", - "start" : ${content_start_8}, - "duration" : ${content_duration_8}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "pass", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_7} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_9}, "duration" : ${content_duration_9}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "test.early_flake.abort_reason" : "faulty", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_9}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_10}, "duration" : ${content_duration_10}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "test.early_flake.abort_reason" : "faulty", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_10} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-parameterized-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-parameterized-test/events.ftl index c26bcd15871..a99c7db5fac 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-parameterized-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-parameterized-test/events.ftl @@ -1,188 +1,201 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestParameterized", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "pass", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestParameterized", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "pass", + "test.suite" : "org.example.TestParameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestParameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", + "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "pass", "test.suite" : "org.example.TestParameterized", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_2}, - "span_id" : ${content_span_id_2}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_3}, - "duration" : ${content_duration_3}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", + "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "pass", "test.suite" : "org.example.TestParameterized", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_4}, "duration" : ${content_duration_4}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "pass", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_5}, "duration" : ${content_duration_5}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "pass", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-test/events.ftl index c6613ad7cfd..df3e613fd0b 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-test/events.ftl @@ -1,140 +1,152 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestSucceed", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "pass", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestSucceed", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "pass", + "test.suite" : "org.example.TestSucceed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestSucceed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceed.test_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "pass", "test.suite" : "org.example.TestSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceed.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_3}, "duration" : ${content_duration_3}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "pass", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_4}, "duration" : ${content_duration_4}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "pass", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-tests-and-new-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-tests-and-new-test/events.ftl index 8580f14f878..49d5e2576c8 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-tests-and-new-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-known-tests-and-new-test/events.ftl @@ -1,332 +1,350 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestFailedAndSucceed", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "fail", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestFailedAndSucceed", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailedAndSucceed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestFailedAndSucceed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 1, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_another_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_another_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_another_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_another_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_2}, - "span_id" : ${content_span_id_2}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", - "start" : ${content_start_3}, - "duration" : ${content_duration_3}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_another_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_another_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_another_succeed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_another_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_3}, - "span_id" : ${content_span_id_3}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", - "start" : ${content_start_4}, - "duration" : ${content_duration_4}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_another_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_another_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "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", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_4}, - "span_id" : ${content_span_id_4}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_failed", - "start" : ${content_start_5}, - "duration" : ${content_duration_5}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_another_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_failed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", "language" : "jvm", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_failed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "error.type" : "java.lang.AssertionError", - "_dd.profiling.ctx" : "test", - "error.message" : ${content_meta_error_message}, - "error.stack" : ${content_meta_error_stack}, - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_5}, - "span_id" : ${content_span_id_5}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestFailedAndSucceed.test_succeed", - "start" : ${content_start_6}, - "duration" : ${content_duration_6}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "pass", "test.suite" : "org.example.TestFailedAndSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailedAndSucceed.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_7}, "duration" : ${content_duration_7}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_8}, "duration" : ${content_duration_8}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-parameterized-test/events.ftl index b9532c8d203..93a00c2b7eb 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-parameterized-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-parameterized-test/events.ftl @@ -1,388 +1,409 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestParameterized", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "fail", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestParameterized", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestParameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestParameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 1, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", + "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "fail", "test.suite" : "org.example.TestParameterized", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_2}, - "span_id" : ${content_span_id_2}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_3}, - "duration" : ${content_duration_3}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", - "span.kind" : "test", - "test.suite" : "org.example.TestParameterized", "runtime-id" : ${content_meta_runtime_id}, - "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_3}, - "span_id" : ${content_span_id_3}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_4}, - "duration" : ${content_duration_4}, - "error" : 0, + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "fail", + "test.suite" : "org.example.TestParameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", - "span.kind" : "test", - "test.suite" : "org.example.TestParameterized", "runtime-id" : ${content_meta_runtime_id}, - "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_4}, - "span_id" : ${content_span_id_4}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_5}, - "duration" : ${content_duration_5}, - "error" : 1, + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "pass", + "test.suite" : "org.example.TestParameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", + "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "fail", "test.suite" : "org.example.TestParameterized", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_5}, - "span_id" : ${content_span_id_5}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_6}, - "duration" : ${content_duration_6}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", - "span.kind" : "test", - "test.suite" : "org.example.TestParameterized", "runtime-id" : ${content_meta_runtime_id}, - "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_6}, - "span_id" : ${content_span_id_6}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestParameterized.parameterized_test_succeed", - "start" : ${content_start_7}, - "duration" : ${content_duration_7}, - "error" : 0, + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "fail", + "test.suite" : "org.example.TestParameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "parameterized_test_succeed", - "span.kind" : "test", - "test.suite" : "org.example.TestParameterized", "runtime-id" : ${content_meta_runtime_id}, - "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "parameterized_test_succeed(Ljava/lang/String;Z)V", + "test.status" : "pass", + "test.suite" : "org.example.TestParameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestParameterized.parameterized_test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_8}, "duration" : ${content_duration_8}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "test.early_flake.abort_reason" : "faulty", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_9}, "duration" : ${content_duration_9}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "test.early_flake.abort_reason" : "faulty", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-slow-test/events.ftl index 54f3e3fe25b..6479410e80c 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-slow-test/events.ftl @@ -1,189 +1,203 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestSucceedSlow", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "fail", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestSucceedSlow", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestSucceedSlow", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestSucceedSlow", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceedSlow.test_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 1, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestSucceedSlow", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_2}, - "span_id" : ${content_span_id_2}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceedSlow.test_succeed", - "start" : ${content_start_3}, - "duration" : ${content_duration_3}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceedSlow.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "pass", "test.suite" : "org.example.TestSucceedSlow", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceedSlow.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_4}, "duration" : ${content_duration_4}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_5}, "duration" : ${content_duration_5}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-test/events.ftl index 6a6b8e4c19c..78c84bafc26 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-test/events.ftl @@ -1,237 +1,253 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestSucceed", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "fail", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestSucceed", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestSucceed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestSucceed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceed.test_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 1, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_2}, - "span_id" : ${content_span_id_2}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceed.test_succeed", - "start" : ${content_start_3}, - "duration" : ${content_duration_3}, - "error" : 1, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceed.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "fail", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "fail", "test.suite" : "org.example.TestSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } -}, { - "type" : "test", - "version" : 2, - "content" : { - "trace_id" : ${content_trace_id_3}, - "span_id" : ${content_span_id_3}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceed.test_succeed", - "start" : ${content_start_4}, - "duration" : ${content_duration_4}, - "error" : 0, + "test_session.name" : "session-name" + }, "metrics" : { - "process_id" : ${content_metrics_process_id}, + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, "test.source.end" : 18, "test.source.start" : 12 }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceed.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.retry_reason" : "efd", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "pass", "test.suite" : "org.example.TestSucceed", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "test.is_retry" : "true", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceed.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_5}, "duration" : ${content_duration_5}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_6}, "duration" : ${content_duration_6}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "fail", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-very-slow-test/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-very-slow-test/events.ftl index 84910662b61..e6460f40dd4 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-very-slow-test/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-efd-new-very-slow-test/events.ftl @@ -1,141 +1,153 @@ [ { - "type" : "test_suite_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_suite", - "resource" : "org.example.TestSucceedVerySlow", - "start" : ${content_start}, "duration" : ${content_duration}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.source.file" : "dummy_source_path", - "test.module" : "testng-7", - "test.status" : "pass", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_suite_end", - "test.suite" : "org.example.TestSucceedVerySlow", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "pass", + "test.suite" : "org.example.TestSucceedVerySlow", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestSucceedVerySlow", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 }, { - "type" : "test", - "version" : 2, "content" : { - "trace_id" : ${content_trace_id}, - "span_id" : ${content_span_id}, - "parent_id" : ${content_parent_id}, - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "test_suite_id" : ${content_test_suite_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test", - "resource" : "org.example.TestSucceedVerySlow.test_succeed", - "start" : ${content_start_2}, "duration" : ${content_duration_2}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0, - "test.source.end" : 18, - "test.source.start" : 12 - }, "meta" : { + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.source.file" : "dummy_source_path", - "test.source.method" : "test_succeed()V", - "test.module" : "testng-7", - "test.status" : "pass", + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "language" : "jvm", - "test.is_new" : "true", - "test.codeowners" : "[\"owner1\",\"owner2\"]", "library_version" : ${content_meta_library_version}, - "test.name" : "test_succeed", + "runtime-id" : ${content_meta_runtime_id}, "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "testng-7", + "test.name" : "test_succeed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_succeed()V", + "test.status" : "pass", "test.suite" : "org.example.TestSucceedVerySlow", - "runtime-id" : ${content_meta_runtime_id}, "test.type" : "test", - "test_session.name" : "session-name", - "env" : "none", - "dummy_ci_tag" : "dummy_ci_tag_value", - "component" : "testng", - "_dd.profiling.ctx" : "test", - "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestSucceedVerySlow.test_succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 }, { - "type" : "test_session_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_session", - "resource" : "testng-7", - "start" : ${content_start_3}, "duration" : ${content_duration_3}, "error" : 0, - "metrics" : { - "process_id" : ${content_metrics_process_id}, - "_dd.profiling.enabled" : 0, - "_dd.trace_span_attribute_schema" : 0 - }, "meta" : { - "test.type" : "test", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", "_dd.tracer_host" : ${content_meta__dd_tracer_host}, - "test.status" : "pass", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "language" : "jvm", - "env" : "none", + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", "library_version" : ${content_meta_library_version}, - "component" : "testng", - "_dd.profiling.ctx" : "test", - "span.kind" : "test_session_end", "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 }, { - "type" : "test_module_end", - "version" : 1, "content" : { - "test_session_id" : ${content_test_session_id}, - "test_module_id" : ${content_test_module_id}, - "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", - "name" : "testng.test_module", - "resource" : "testng-7", - "start" : ${content_start_4}, "duration" : ${content_duration_4}, "error" : 0, - "metrics" : { }, "meta" : { - "test.type" : "test", - "test.module" : "testng-7", - "test.status" : "pass", - "test.early_flake.enabled" : "true", - "test_session.name" : "session-name", - "env" : "none", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", "library_version" : ${content_meta_library_version}, - "component" : "testng", "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, - "test.framework" : "testng" - } - } + "test.module" : "testng-7", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 } ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-7/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-7/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-7/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-7/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-7/events.ftl new file mode 100644 index 00000000000..65f4bf6b328 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-7/events.ftl @@ -0,0 +1,154 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "testng-7", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-7/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-7/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-7/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-7/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-7/events.ftl new file mode 100644 index 00000000000..f1039d9b205 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-7/events.ftl @@ -0,0 +1,367 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.management.is_quarantined" : "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", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "testng-7", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-latest/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-latest/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-latest/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-latest/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-latest/events.ftl new file mode 100644 index 00000000000..c7b50f79d7b --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-atr-latest/events.ftl @@ -0,0 +1,341 @@ +[ { + "type" : "test_suite_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test_suite", + "resource" : "org.example.TestFailed", + "start" : ${content_start}, + "duration" : ${content_duration}, + "error" : 0, + "metrics" : { }, + "meta" : { + "test.type" : "test", + "test.source.file" : "dummy_source_path", + "test.module" : "testng-7", + "test.status" : "fail", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "library_version" : ${content_meta_library_version}, + "component" : "testng", + "span.kind" : "test_suite_end", + "test.suite" : "org.example.TestFailed", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test", + "version" : 2, + "content" : { + "trace_id" : ${content_trace_id}, + "span_id" : ${content_span_id}, + "parent_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test", + "resource" : "org.example.TestFailed.test_failed", + "start" : ${content_start_2}, + "duration" : ${content_duration_2}, + "error" : 1, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "meta" : { + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.module" : "testng-7", + "test.status" : "fail", + "language" : "jvm", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "library_version" : ${content_meta_library_version}, + "test.name" : "test_failed", + "span.kind" : "test", + "test.suite" : "org.example.TestFailed", + "runtime-id" : ${content_meta_runtime_id}, + "test.type" : "test", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "component" : "testng", + "error.type" : "java.lang.AssertionError", + "_dd.profiling.ctx" : "test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test", + "version" : 2, + "content" : { + "trace_id" : ${content_trace_id_2}, + "span_id" : ${content_span_id_2}, + "parent_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test", + "resource" : "org.example.TestFailed.test_failed", + "start" : ${content_start_3}, + "duration" : ${content_duration_3}, + "error" : 1, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "meta" : { + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.module" : "testng-7", + "test.status" : "fail", + "language" : "jvm", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "library_version" : ${content_meta_library_version}, + "test.name" : "test_failed", + "span.kind" : "test", + "test.suite" : "org.example.TestFailed", + "runtime-id" : ${content_meta_runtime_id}, + "test.type" : "test", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "test.is_retry" : "true", + "component" : "testng", + "error.type" : "java.lang.AssertionError", + "_dd.profiling.ctx" : "test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test", + "version" : 2, + "content" : { + "trace_id" : ${content_trace_id_3}, + "span_id" : ${content_span_id_3}, + "parent_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test", + "resource" : "org.example.TestFailed.test_failed", + "start" : ${content_start_4}, + "duration" : ${content_duration_4}, + "error" : 1, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "meta" : { + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.module" : "testng-7", + "test.status" : "fail", + "language" : "jvm", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "library_version" : ${content_meta_library_version}, + "test.name" : "test_failed", + "span.kind" : "test", + "test.suite" : "org.example.TestFailed", + "runtime-id" : ${content_meta_runtime_id}, + "test.type" : "test", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "test.is_retry" : "true", + "component" : "testng", + "error.type" : "java.lang.AssertionError", + "_dd.profiling.ctx" : "test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test", + "version" : 2, + "content" : { + "trace_id" : ${content_trace_id_4}, + "span_id" : ${content_span_id_4}, + "parent_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test", + "resource" : "org.example.TestFailed.test_failed", + "start" : ${content_start_5}, + "duration" : ${content_duration_5}, + "error" : 1, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "meta" : { + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.module" : "testng-7", + "test.status" : "fail", + "language" : "jvm", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "library_version" : ${content_meta_library_version}, + "test.name" : "test_failed", + "span.kind" : "test", + "test.suite" : "org.example.TestFailed", + "runtime-id" : ${content_meta_runtime_id}, + "test.type" : "test", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "test.is_retry" : "true", + "component" : "testng", + "error.type" : "java.lang.AssertionError", + "_dd.profiling.ctx" : "test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test", + "version" : 2, + "content" : { + "trace_id" : ${content_trace_id_5}, + "span_id" : ${content_span_id_5}, + "parent_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test", + "resource" : "org.example.TestFailed.test_failed", + "start" : ${content_start_6}, + "duration" : ${content_duration_6}, + "error" : 1, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "meta" : { + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.module" : "testng-7", + "test.status" : "fail", + "language" : "jvm", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "library_version" : ${content_meta_library_version}, + "test.name" : "test_failed", + "span.kind" : "test", + "test.suite" : "org.example.TestFailed", + "runtime-id" : ${content_meta_runtime_id}, + "test.type" : "test", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "test.is_retry" : "true", + "component" : "testng", + "error.type" : "java.lang.AssertionError", + "_dd.profiling.ctx" : "test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test_session_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test_session", + "resource" : "testng-7", + "start" : ${content_start_7}, + "duration" : ${content_duration_7}, + "error" : 0, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0 + }, + "meta" : { + "test.type" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.status" : "fail", + "test_session.name" : "session-name", + "language" : "jvm", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "library_version" : ${content_meta_library_version}, + "component" : "testng", + "_dd.profiling.ctx" : "test", + "span.kind" : "test_session_end", + "runtime-id" : ${content_meta_runtime_id}, + "test.command" : "testng-7", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test_module_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test_module", + "resource" : "testng-7", + "start" : ${content_start_8}, + "duration" : ${content_duration_8}, + "error" : 0, + "metrics" : { }, + "meta" : { + "test.type" : "test", + "test.module" : "testng-7", + "test.status" : "fail", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "library_version" : ${content_meta_library_version}, + "component" : "testng", + "span.kind" : "test_module_end", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-efd/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-efd/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-efd/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 98% rename from dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-efd/events.ftl rename to dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-efd/events.ftl index 993a1c17b0f..335d848e69b 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-efd/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -55,6 +55,7 @@ "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", + "test.management.is_quarantined" : "true", "test.module" : "testng-7", "test.name" : "test_failed", "test.source.file" : "dummy_source_path", @@ -105,8 +106,10 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "testng-7", "test.name" : "test_failed", "test.retry_reason" : "efd", @@ -160,6 +163,7 @@ "test.framework_version" : ${content_meta_test_framework_version}, "test.is_new" : "true", "test.is_retry" : "true", + "test.management.is_quarantined" : "true", "test.module" : "testng-7", "test.name" : "test_failed", "test.retry_reason" : "efd", diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-known/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-known/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..49a6099e0c5 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,156 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.source.file" : "dummy_source_path", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "testng.test_suite", + "resource" : "org.example.TestFailed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", + "test.module" : "testng-7", + "test.name" : "test_failed", + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.status" : "fail", + "test.suite" : "org.example.TestFailed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "name" : "testng.test", + "parent_id" : ${content_parent_id}, + "resource" : "org.example.TestFailed.test_failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "testng-7", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "testng.test_session", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "testng", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "testng", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "testng-7", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "testng.test_module", + "resource" : "testng-7", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-latest/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-latest/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-latest/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-latest/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-latest/events.ftl new file mode 100644 index 00000000000..325fdb0456f --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-latest/events.ftl @@ -0,0 +1,141 @@ +[ { + "type" : "test_suite_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test_suite", + "resource" : "org.example.TestFailed", + "start" : ${content_start}, + "duration" : ${content_duration}, + "error" : 0, + "metrics" : { }, + "meta" : { + "test.type" : "test", + "test.source.file" : "dummy_source_path", + "test.module" : "testng-7", + "test.status" : "fail", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "library_version" : ${content_meta_library_version}, + "component" : "testng", + "span.kind" : "test_suite_end", + "test.suite" : "org.example.TestFailed", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test", + "version" : 2, + "content" : { + "trace_id" : ${content_trace_id}, + "span_id" : ${content_span_id}, + "parent_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "test_suite_id" : ${content_test_suite_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test", + "resource" : "org.example.TestFailed.test_failed", + "start" : ${content_start_2}, + "duration" : ${content_duration_2}, + "error" : 1, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 18, + "test.source.start" : 12 + }, + "meta" : { + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.source.file" : "dummy_source_path", + "test.source.method" : "test_failed()V", + "test.module" : "testng-7", + "test.status" : "fail", + "language" : "jvm", + "test.codeowners" : "[\"owner1\",\"owner2\"]", + "library_version" : ${content_meta_library_version}, + "test.name" : "test_failed", + "span.kind" : "test", + "test.suite" : "org.example.TestFailed", + "runtime-id" : ${content_meta_runtime_id}, + "test.type" : "test", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "component" : "testng", + "error.type" : "java.lang.AssertionError", + "_dd.profiling.ctx" : "test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test_session_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test_session", + "resource" : "testng-7", + "start" : ${content_start_3}, + "duration" : ${content_duration_3}, + "error" : 0, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0 + }, + "meta" : { + "test.type" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "test.status" : "fail", + "test_session.name" : "session-name", + "language" : "jvm", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "library_version" : ${content_meta_library_version}, + "component" : "testng", + "_dd.profiling.ctx" : "test", + "span.kind" : "test_session_end", + "runtime-id" : ${content_meta_runtime_id}, + "test.command" : "testng-7", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +}, { + "type" : "test_module_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "name" : "testng.test_module", + "resource" : "testng-7", + "start" : ${content_start_4}, + "duration" : ${content_duration_4}, + "error" : 0, + "metrics" : { }, + "meta" : { + "test.type" : "test", + "test.module" : "testng-7", + "test.status" : "fail", + "test_session.name" : "session-name", + "env" : "none", + "dummy_ci_tag" : "dummy_ci_tag_value", + "library_version" : ${content_meta_library_version}, + "component" : "testng", + "span.kind" : "test_module_end", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.framework" : "testng" + } + } +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-parameterized/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-parameterized/events.ftl b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-parameterized/events.ftl similarity index 98% rename from dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-parameterized/events.ftl rename to dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-parameterized/events.ftl index fd3e510422b..25f435dc2fb 100644 --- a/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-failed-parameterized/events.ftl +++ b/dd-java-agent/instrumentation/testng/testng-7/src/test/resources/test-quarantined-failed-parameterized/events.ftl @@ -51,6 +51,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"hello\",\"1\":\"true\"}}", @@ -101,6 +102,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, + "test.management.is_quarantined" : "true", "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", "test.parameters" : "{\"arguments\":{\"0\":\"\\\"goodbye\\\"\",\"1\":\"false\"}}", 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 6790eee4224..c1902052675 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 @@ -208,6 +208,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_error", 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 94397e26158..863605ca59d 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 @@ -208,6 +208,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "test_failed", 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 7ef1dcdbf3f..377f0ea9afd 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 @@ -255,6 +255,7 @@ "test.codeowners" : "[\"owner1\",\"owner2\"]", "test.framework" : "testng", "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", "test.is_retry" : "true", "test.module" : "testng-7", "test.name" : "parameterized_test_succeed", 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 513dbdd1ff2..19b59a1370e 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 @@ -5,7 +5,7 @@ import datadog.trace.api.civisibility.events.TestDescriptor; import datadog.trace.api.civisibility.events.TestEventsHandler; import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.api.time.SystemTimeSource; import datadog.trace.util.AgentThreadFactory; @@ -92,7 +92,7 @@ public static void onTestFinished(TestFinished event, TaskDef taskDef) { new TestDescriptor(testSuiteName, testClass, testName, testParameters, testQualifier); String testMethodName = null; Method testMethod = null; - RetryReason retryReason = null; + TestExecutionHistory executionHistory = null; // Only test finish is reported, so fake test start timestamp long endMicros = SystemTimeSource.INSTANCE.getCurrentTimeMicros(); @@ -106,8 +106,8 @@ public static void onTestFinished(TestFinished event, TaskDef taskDef) { testParameters, categories, new TestSourceData(testClass, testMethod, testMethodName), - retryReason, - startMicros); + startMicros, + executionHistory); if (testOutcome.result() instanceof Result.Ignored) { Result.Ignored result = (Result.Ignored) testOutcome.result(); @@ -131,6 +131,6 @@ public static void onTestFinished(TestFinished event, TaskDef taskDef) { TEST_EVENTS_HANDLER.onTestFailure(testDescriptor, throwable); } - TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, endMicros); + TEST_EVENTS_HANDLER.onTestFinish(testDescriptor, endMicros, executionHistory); } } 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 801ff7b642f..7f683c515e8 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 @@ -4,8 +4,8 @@ import datadog.trace.api.civisibility.DDTestSuite; import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionHistory; import datadog.trace.api.civisibility.execution.TestExecutionPolicy; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; import datadog.trace.api.civisibility.telemetry.tag.SkipReason; import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; import datadog.trace.bootstrap.ContextStore; @@ -52,9 +52,8 @@ void onTestSuiteStart( * 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) + * @param testExecutionHistory the history of executions of this test case */ void onTestStart( SuiteKey suiteDescriptor, @@ -65,14 +64,17 @@ void onTestStart( @Nullable String testParameters, @Nullable Collection categories, @Nonnull TestSourceData testSourceData, - @Nullable RetryReason retryReason, - @Nullable Long startTime); + @Nullable Long startTime, + @Nullable TestExecutionHistory testExecutionHistory); void onTestSkip(TestKey descriptor, @Nullable String reason); void onTestFailure(TestKey descriptor, @Nullable Throwable throwable); - void onTestFinish(TestKey descriptor, @Nullable Long endTime); + void onTestFinish( + TestKey descriptor, + @Nullable Long endTime, + @Nullable TestExecutionHistory testExecutionHistory); void onTestIgnore( SuiteKey suiteDescriptor, diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionHistory.java b/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionHistory.java new file mode 100644 index 00000000000..adeef1aa716 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionHistory.java @@ -0,0 +1,20 @@ +package datadog.trace.api.civisibility.execution; + +import datadog.trace.api.civisibility.telemetry.tag.RetryReason; +import javax.annotation.Nullable; + +public interface TestExecutionHistory { + + /** + * @return retry reason for current test execution ({@code null} if current execution is not a + * retry) + */ + @Nullable + RetryReason currentExecutionRetryReason(); + + /** + * @return {@code true} if the test has failed all retry attempts (only for policies that allow + * multiple retries) + */ + boolean hasFailedAllRetries(); +} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionPolicy.java b/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionPolicy.java index 594568a03b0..5489a809548 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionPolicy.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/execution/TestExecutionPolicy.java @@ -1,9 +1,6 @@ package datadog.trace.api.civisibility.execution; -import datadog.trace.api.civisibility.telemetry.tag.RetryReason; -import javax.annotation.Nullable; - -public interface TestExecutionPolicy { +public interface TestExecutionPolicy extends TestExecutionHistory { /** * @return {@code true} if the next execution of the test will be altered in any way. This method @@ -25,11 +22,4 @@ public interface TestExecutionPolicy { * @return {@code true} if another execution of the same test should be done */ boolean retry(boolean successful, long durationMillis); - - /** - * @return retry reason for current test execution ({@code null} if current execution is not a - * retry) - */ - @Nullable - RetryReason 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 a5b0cc5d4cd..65aa7a6dd75 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,11 +15,12 @@ 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.HasFailedAllRetries; 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; import datadog.trace.api.civisibility.telemetry.tag.IsNew; +import datadog.trace.api.civisibility.telemetry.tag.IsQuarantined; import datadog.trace.api.civisibility.telemetry.tag.IsRetry; import datadog.trace.api.civisibility.telemetry.tag.IsRum; import datadog.trace.api.civisibility.telemetry.tag.IsUnsupportedCI; @@ -53,8 +54,7 @@ public enum CiVisibilityCountMetric { EventType.class, IsHeadless.class, HasCodeowner.class, - IsUnsupportedCI.class, - IsBenchmark.class), + IsUnsupportedCI.class), /** The number of events finished */ EVENT_FINISHED( "event_finished", @@ -63,11 +63,17 @@ public enum CiVisibilityCountMetric { IsHeadless.class, HasCodeowner.class, IsUnsupportedCI.class, - IsBenchmark.class, - EarlyFlakeDetectionAbortReason.class, + EarlyFlakeDetectionAbortReason.class), + /** The number of test events finished */ + TEST_EVENT_FINISHED( + "event_finished", + TestFrameworkInstrumentation.class, + EventType.class, IsNew.class, IsModified.class, + IsQuarantined.class, IsRetry.class, + HasFailedAllRetries.class, RetryReason.class, IsRum.class, BrowserDriver.class), diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/HasFailedAllRetries.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/HasFailedAllRetries.java new file mode 100644 index 00000000000..ca8e4f9a8fd --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/HasFailedAllRetries.java @@ -0,0 +1,12 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +public enum HasFailedAllRetries implements TagValue { + TRUE; + + @Override + public String asString() { + return "has_failed_all_retries:true"; + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsBenchmark.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsBenchmark.java deleted file mode 100644 index 901fd994a5b..00000000000 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsBenchmark.java +++ /dev/null @@ -1,15 +0,0 @@ -package datadog.trace.api.civisibility.telemetry.tag; - -import datadog.trace.api.civisibility.telemetry.TagValue; - -/** - * Whether a test case is a benchmark (that is a test cases of a benchmarking framework, e.g. JMH). - */ -public enum IsBenchmark implements TagValue { - TRUE; - - @Override - public String asString() { - return "is_benchmark:true"; - } -} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsQuarantined.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsQuarantined.java new file mode 100644 index 00000000000..b8122301e22 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsQuarantined.java @@ -0,0 +1,12 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +public enum IsQuarantined implements TagValue { + TRUE; + + @Override + public String asString() { + return "is_quarantined:true"; + } +} 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 47e4a0d45b3..a0bfe78ef10 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 @@ -96,6 +96,8 @@ public class Tags { 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 TEST_HAS_FAILED_ALL_RETRIES = "test.has_failed_all_retries"; + public static final String TEST_MANAGEMENT_IS_QUARANTINED = "test.management.is_quarantined"; public static final String CI_PROVIDER_NAME = "ci.provider.name"; public static final String CI_PIPELINE_ID = "ci.pipeline.id";