From 93c9b9557c62368df935e95345a02973f648cb68 Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko Date: Tue, 2 Jul 2024 18:28:34 +0200 Subject: [PATCH] Fix -DargLine propagation for Maven builds --- .../maven3/MavenLifecycleParticipant.java | 4 +- .../maven3/MavenProjectConfigurator.java | 50 ++--- .../instrumentation/maven3/MavenUtils.java | 11 ++ .../datadog/smoketest/MavenSmokeTest.groovy | 35 ++-- .../coverages.ftl | 9 + .../events.ftl | 175 ++++++++++++++++++ .../pom.xml | 62 +++++++ .../smoke/TestSucceedPropertyAssertion.java | 14 ++ 8 files changed, 308 insertions(+), 52 deletions(-) create mode 100644 dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/coverages.ftl create mode 100644 dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/events.ftl create mode 100644 dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/pom.xml create mode 100644 dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java diff --git a/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenLifecycleParticipant.java b/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenLifecycleParticipant.java index 456d1b994bf..fad85787082 100644 --- a/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenLifecycleParticipant.java +++ b/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenLifecycleParticipant.java @@ -298,9 +298,7 @@ private Void configureTestExecutions( for (MavenTestExecution testExecution : testExecutions) { MavenProjectConfigurator.INSTANCE.configureTracer( - testExecution.getProject(), - testExecution.getExecution(), - moduleExecutionSettings.getSystemProperties()); + testExecution, moduleExecutionSettings.getSystemProperties()); MavenProjectConfigurator.INSTANCE.configureJacoco(testExecution, moduleExecutionSettings); } return null; diff --git a/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenProjectConfigurator.java b/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenProjectConfigurator.java index 5f0f214fb9d..104774f779b 100644 --- a/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenProjectConfigurator.java +++ b/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenProjectConfigurator.java @@ -18,6 +18,7 @@ import org.apache.maven.model.PluginExecution; import org.apache.maven.plugin.MojoExecution; import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.configuration.PlexusConfiguration; import org.codehaus.plexus.util.xml.Xpp3Dom; class MavenProjectConfigurator { @@ -33,32 +34,29 @@ class MavenProjectConfigurator { private static final String JAVAC_COMPILER_ID = "javac"; private static final String DATADOG_COMPILER_PLUGIN_ID = "DatadogCompilerPlugin"; - private static final ComparableVersion LATE_SUBSTITUTION_SUPPORTED_VERSION = - new ComparableVersion("2.17"); private static final String JACOCO_EXCL_CLASS_LOADERS_PROPERTY = "jacoco.exclClassLoaders"; public void configureTracer( - MavenProject project, - MojoExecution mojoExecution, - Map propagatedSystemProperties) { - Xpp3Dom configuration = mojoExecution.getConfiguration(); + MavenTestExecution mavenTestExecution, Map propagatedSystemProperties) { + MojoExecution mojoExecution = mavenTestExecution.getExecution(); + PlexusConfiguration pomConfiguration = MavenUtils.getPomConfiguration(mojoExecution); - Xpp3Dom forkCount = configuration.getChild("forkCount"); + PlexusConfiguration forkCount = pomConfiguration.getChild("forkCount"); if (forkCount != null && "0".equals(forkCount.getValue())) { // tests will be executed inside this JVM, no need for additional configuration return; } - StringBuilder modifiedArgLine = new StringBuilder(); + StringBuilder addedArgLine = new StringBuilder(); // propagate to child process all "dd." system properties available in current process for (Map.Entry e : propagatedSystemProperties.entrySet()) { - modifiedArgLine.append("-D").append(e.getKey()).append('=').append(e.getValue()).append(" "); + addedArgLine.append("-D").append(e.getKey()).append('=').append(e.getValue()).append(" "); } Config config = Config.get(); Integer ciVisibilityDebugPort = config.getCiVisibilityDebugPort(); if (ciVisibilityDebugPort != null) { - modifiedArgLine + addedArgLine .append("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=") .append(ciVisibilityDebugPort) .append(" "); @@ -66,11 +64,12 @@ public void configureTracer( String additionalArgs = config.getCiVisibilityAdditionalChildProcessJvmArgs(); if (additionalArgs != null) { - modifiedArgLine.append(additionalArgs).append(" "); + addedArgLine.append(additionalArgs).append(" "); } + MavenProject project = mavenTestExecution.getProject(); String moduleName = MavenUtils.getUniqueModuleName(project, mojoExecution); - modifiedArgLine + addedArgLine .append("-D") .append( Strings.propertyNameToSystemPropertyName(CiVisibilityConfig.CIVISIBILITY_MODULE_NAME)) @@ -79,43 +78,30 @@ public void configureTracer( .append("' "); File agentJar = config.getCiVisibilityAgentJarFile(); - modifiedArgLine.append("-javaagent:").append(agentJar.toPath()); + addedArgLine.append("-javaagent:").append(agentJar.toPath()); Plugin plugin = mojoExecution.getPlugin(); Map pluginExecutions = plugin.getExecutionsAsMap(); PluginExecution pluginExecution = pluginExecutions.get(mojoExecution.getExecutionId()); Xpp3Dom executionConfiguration = (Xpp3Dom) pluginExecution.getConfiguration(); - String argLine = MavenUtils.getConfigurationValue(executionConfiguration, "argLine"); - boolean projectWideArgLineNeeded = argLine == null || !argLine.contains("{argLine}"); - - String finalArgLine = - (projectWideArgLineNeeded ? getReferenceToProjectWideArgLine(plugin) + " " : "") - + (argLine != null ? argLine + " " : "") + PlexusConfiguration argLineConfiguration = pomConfiguration.getChild("argLine"); + String existingArgLine = argLineConfiguration.getValue(); + String updatedArgLine = + (existingArgLine != null ? existingArgLine + " " : "") + // -javaagent that injects the tracer // has to be the last one, // since if there are other agents // we want to be able to instrument their code // (namely Jacoco's) - modifiedArgLine; + addedArgLine; Xpp3Dom updatedExecutionConfiguration = - MavenUtils.setConfigurationValue(finalArgLine, executionConfiguration, "argLine"); + MavenUtils.setConfigurationValue(updatedArgLine, executionConfiguration, "argLine"); pluginExecution.setConfiguration(updatedExecutionConfiguration); } - private static String getReferenceToProjectWideArgLine(Plugin plugin) { - String pluginVersion = plugin.getVersion(); - ComparableVersion pluginVersionParsed = - new ComparableVersion(pluginVersion != null ? pluginVersion : ""); - if (pluginVersionParsed.compareTo(LATE_SUBSTITUTION_SUPPORTED_VERSION) >= 0) { - return "@{argLine} "; - } else { - return "${argLine} "; - } - } - void configureCompilerPlugin(MavenProject project, String compilerPluginVersion) { Plugin compilerPlugin = project.getPlugin(MAVEN_COMPILER_PLUGIN_KEY); if (compilerPlugin == null || compilerPluginVersion == null) { diff --git a/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java b/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java index e82814ef5cb..bde0c336c27 100644 --- a/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java +++ b/dd-java-agent/instrumentation/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java @@ -15,6 +15,8 @@ import org.apache.maven.plugin.MojoExecution; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.xml.Xpp3Dom; @@ -298,4 +300,13 @@ public static PlexusContainer getContainer(MavenSession mavenSession) { } return METHOD_HANDLES.invoke(LOOKUP_METHOD, lookup, PlexusContainer.class); } + + public static PlexusConfiguration getPomConfiguration(MojoExecution mojoExecution) { + Xpp3Dom configuration = mojoExecution.getConfiguration(); + if (configuration == null) { + return new XmlPlexusConfiguration("configuration"); + } else { + return new XmlPlexusConfiguration(configuration); + } + } } diff --git a/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy b/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy index 531e0b36688..5055f7d0cda 100644 --- a/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy +++ b/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy @@ -68,7 +68,7 @@ class MavenSmokeTest extends CiVisibilitySmokeTest { mockBackend.givenFlakyTest("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestFailed", "test_failed") mockBackend.givenSkippableTest("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestSucceed", "test_to_skip_with_itr") - def exitCode = whenRunningMavenBuild(jacocoCoverage) + def exitCode = whenRunningMavenBuild(jacocoCoverage, commandLineParams) if (expectSuccess) { assert exitCode == 0 @@ -80,20 +80,21 @@ class MavenSmokeTest extends CiVisibilitySmokeTest { verifyTelemetryMetrics(mockBackend.getAllReceivedTelemetryMetrics(), mockBackend.getAllReceivedTelemetryDistributions(), expectedEvents) where: - projectName | mavenVersion | expectedEvents | expectedCoverages | expectSuccess | flakyRetries | jacocoCoverage | minSupportedJavaVersion - "test_successful_maven_run" | "3.2.1" | 5 | 1 | true | false | true | 8 - "test_successful_maven_run" | "3.5.4" | 5 | 1 | true | false | true | 8 - "test_successful_maven_run" | "3.6.3" | 5 | 1 | true | false | true | 8 - "test_successful_maven_run" | "3.8.8" | 5 | 1 | true | false | true | 8 - "test_successful_maven_run" | "3.9.7" | 5 | 1 | true | false | true | 8 - "test_successful_maven_run_surefire_3_0_0" | "3.9.7" | 5 | 1 | true | false | true | 8 - "test_successful_maven_run_surefire_3_0_0" | LATEST_MAVEN_VERSION | 5 | 1 | true | false | true | 17 - "test_successful_maven_run_builtin_coverage" | "3.9.7" | 5 | 1 | true | false | false | 8 - "test_successful_maven_run_with_jacoco_and_argline" | "3.9.7" | 5 | 1 | true | false | true | 8 + projectName | mavenVersion | expectedEvents | expectedCoverages | expectSuccess | flakyRetries | jacocoCoverage | commandLineParams | minSupportedJavaVersion + "test_successful_maven_run" | "3.2.1" | 5 | 1 | true | false | true | [] | 8 + "test_successful_maven_run" | "3.5.4" | 5 | 1 | true | false | true | [] | 8 + "test_successful_maven_run" | "3.6.3" | 5 | 1 | true | false | true | [] | 8 + "test_successful_maven_run" | "3.8.8" | 5 | 1 | true | false | true | [] | 8 + "test_successful_maven_run" | "3.9.8" | 5 | 1 | true | false | true | [] | 8 + "test_successful_maven_run_surefire_3_0_0" | "3.9.8" | 5 | 1 | true | false | true | [] | 8 + "test_successful_maven_run_surefire_3_0_0" | LATEST_MAVEN_VERSION | 5 | 1 | true | false | true | [] | 17 + "test_successful_maven_run_builtin_coverage" | "3.9.8" | 5 | 1 | true | false | false | [] | 8 + "test_successful_maven_run_with_jacoco_and_argline" | "3.9.8" | 5 | 1 | true | false | true | [] | 8 // "expectedEvents" count for this test case does not include the spans that correspond to Cucumber steps - "test_successful_maven_run_with_cucumber" | "3.9.7" | 4 | 1 | true | false | true | 8 - "test_failed_maven_run_flaky_retries" | "3.9.7" | 8 | 5 | false | true | true | 8 - "test_successful_maven_run_junit_platform_runner" | "3.9.7" | 4 | 0 | true | false | false | 8 + "test_successful_maven_run_with_cucumber" | "3.9.8" | 4 | 1 | true | false | true | [] | 8 + "test_failed_maven_run_flaky_retries" | "3.9.8" | 8 | 5 | false | true | true | [] | 8 + "test_successful_maven_run_junit_platform_runner" | "3.9.8" | 4 | 0 | true | false | false | [] | 8 + "test_successful_maven_run_with_arg_line_property" | "3.9.8" | 4 | 0 | true | false | false | ["-DargLine='-Dmy-custom-property=provided-via-command-line'"] | 8 } private void givenWrapperPropertiesFile(String mavenVersion) { @@ -169,15 +170,15 @@ class MavenSmokeTest extends CiVisibilitySmokeTest { throw new AssertionError((Object) "Tried $DEPENDENCIES_DOWNLOAD_RETRIES times to execute $mvnCommand and failed") } - private int whenRunningMavenBuild(boolean injectJacoco) { - def processBuilder = createProcessBuilder(["-B", "test"], true, injectJacoco) + private int whenRunningMavenBuild(boolean injectJacoco, List additionalCommandLineParams) { + def processBuilder = createProcessBuilder(["-B", "test"] + additionalCommandLineParams, true, injectJacoco) processBuilder.environment().put("DD_API_KEY", "01234567890abcdef123456789ABCDEF") return runProcess(processBuilder.start()) } - private runProcess(Process p) { + private static runProcess(Process p) { StreamConsumer errorGobbler = new StreamConsumer(p.getErrorStream(), "ERROR") StreamConsumer outputGobbler = new StreamConsumer(p.getInputStream(), "OUTPUT") outputGobbler.start() diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/coverages.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/coverages.ftl new file mode 100644 index 00000000000..f3bb5186115 --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/coverages.ftl @@ -0,0 +1,9 @@ +[ { + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "span_id" : ${content_span_id}, + "files" : [ { + "filename" : "src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java", + "segments" : [ ] + } ] +} ] \ No newline at end of file diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/events.ftl new file mode 100644 index 00000000000..9eb89f813cf --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/events.ftl @@ -0,0 +1,175 @@ +[ { + "type" : "test_session_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "service" : "test-maven-service", + "name" : "maven.test_session", + "resource" : "Maven Smoke Tests Project", + "start" : ${content_start}, + "duration" : ${content_duration}, + "error" : 0, + "metrics" : { + "process_id" : ${content_metrics_process_id}, + "test.itr.tests_skipping.count" : 0, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0 + }, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "os.architecture" : ${content_meta_os_architecture}, + "test.status" : "pass", + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "language" : "jvm", + "runtime.name" : ${content_meta_runtime_name}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_session_end", + "runtime.version" : ${content_meta_runtime_version}, + "runtime-id" : ${content_meta_runtime_id}, + "test.itr.tests_skipping.enabled" : "true", + "test.type" : "test", + "env" : "integration-test", + "runtime.vendor" : ${content_meta_runtime_vendor}, + "component" : "maven", + "test.code_coverage.enabled" : "true", + "test.toolchain" : ${content_meta_test_toolchain}, + "test.itr.tests_skipping.type" : "test", + "test.command" : "mvn -B test", + "test.framework_version" : "4.13.2", + "test.framework" : "junit4" + } + } +}, { + "type" : "test_module_end", + "version" : 1, + "content" : { + "test_session_id" : ${content_test_session_id}, + "test_module_id" : ${content_test_module_id}, + "service" : "test-maven-service", + "name" : "maven.test_module", + "resource" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "start" : ${content_start_2}, + "duration" : ${content_duration_2}, + "error" : 0, + "metrics" : { + "test.itr.tests_skipping.count" : 0 + }, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "test.type" : "test", + "os.architecture" : ${content_meta_os_architecture}, + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.status" : "pass", + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "runtime.name" : ${content_meta_runtime_name}, + "env" : "integration-test", + "runtime.vendor" : ${content_meta_runtime_vendor}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "library_version" : ${content_meta_library_version}, + "component" : "maven", + "test.code_coverage.enabled" : "true", + "span.kind" : "test_module_end", + "test.execution" : "maven-surefire-plugin:test:default-test", + "test.itr.tests_skipping.type" : "test", + "runtime.version" : ${content_meta_runtime_version}, + "test.command" : "mvn -B test", + "test.framework_version" : "4.13.2", + "test.framework" : "junit4", + "test.itr.tests_skipping.enabled" : "true" + } + } +}, { + "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" : "test-maven-service", + "name" : "junit.test_suite", + "resource" : "datadog.smoke.TestSucceedPropertyAssertion", + "start" : ${content_start_3}, + "duration" : ${content_duration_3}, + "error" : 0, + "metrics" : { + "process_id" : ${content_metrics_process_id_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0 + }, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "os.architecture" : ${content_meta_os_architecture}, + "test.source.file" : "src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.status" : "pass", + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "language" : "jvm", + "runtime.name" : ${content_meta_runtime_name}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.suite" : "datadog.smoke.TestSucceedPropertyAssertion", + "runtime.version" : ${content_meta_runtime_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "test.type" : "test", + "env" : "integration-test", + "runtime.vendor" : ${content_meta_runtime_vendor}, + "component" : "junit", + "test.framework_version" : "4.13.2", + "test.framework" : "junit4" + } + } +}, { + "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" : "test-maven-service", + "name" : "junit.test", + "resource" : "datadog.smoke.TestSucceedPropertyAssertion.test_succeed", + "start" : ${content_start_4}, + "duration" : ${content_duration_4}, + "error" : 0, + "metrics" : { + "process_id" : ${content_metrics_process_id_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "test.source.end" : 12, + "test.source.start" : 9 + }, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_4}, + "os.architecture" : ${content_meta_os_architecture}, + "test.source.file" : "src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java", + "test.source.method" : "test_succeed()V", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.status" : "pass", + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "language" : "jvm", + "runtime.name" : ${content_meta_runtime_name}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "library_version" : ${content_meta_library_version}, + "test.name" : "test_succeed", + "span.kind" : "test", + "test.suite" : "datadog.smoke.TestSucceedPropertyAssertion", + "runtime.version" : ${content_meta_runtime_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "test.type" : "test", + "env" : "integration-test", + "runtime.vendor" : ${content_meta_runtime_vendor}, + "component" : "junit", + "test.framework_version" : "4.13.2", + "test.framework" : "junit4" + } + } +} ] \ No newline at end of file diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/pom.xml b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/pom.xml new file mode 100644 index 00000000000..1680265ee15 --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/pom.xml @@ -0,0 +1,62 @@ + + + + 4.0.0 + com.datadog.ci.test + maven-smoke-test + 1.0-SNAPSHOT + Maven Smoke Tests Project + + + 8 + 8 + UTF-8 + + + + + + + false + + central + Central Repository + https://repo.maven.apache.org/maven2 + + + + + + never + + + false + + central + Central Repository + https://repo.maven.apache.org/maven2 + + + + + + junit + junit + 4.13.2 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.17 + + + + + diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java new file mode 100644 index 00000000000..c41c068655e --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_arg_line_property/src/test/java/datadog/smoke/TestSucceedPropertyAssertion.java @@ -0,0 +1,14 @@ +package datadog.smoke; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class TestSucceedPropertyAssertion { + + @Test + public void test_succeed() { + assertEquals("provided-via-command-line", System.getProperty("my-custom-property")); + } + +}