diff --git a/instrumentation-api-incubator/build.gradle.kts b/instrumentation-api-incubator/build.gradle.kts index ac89198702..5da4069747 100644 --- a/instrumentation-api-incubator/build.gradle.kts +++ b/instrumentation-api-incubator/build.gradle.kts @@ -28,30 +28,6 @@ dependencies { testImplementation("io.opentelemetry:opentelemetry-sdk-extension-incubator") } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database,code") - } - } - } - } - - val testBothSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database/dup,code/dup") - } - } - } - } - } -} - tasks { // exclude auto-generated code named("checkstyleMain") { @@ -69,7 +45,19 @@ tasks { dependsOn("generateJflex") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database,code") + } + + val testBothSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database/dup,code/dup") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv, testBothSemconv) } } diff --git a/instrumentation/alibaba-druid-1.0/javaagent/build.gradle.kts b/instrumentation/alibaba-druid-1.0/javaagent/build.gradle.kts index 74d7f68924..a09f94a642 100644 --- a/instrumentation/alibaba-druid-1.0/javaagent/build.gradle.kts +++ b/instrumentation/alibaba-druid-1.0/javaagent/build.gradle.kts @@ -21,28 +21,20 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/alibaba-druid-1.0/library/build.gradle.kts b/instrumentation/alibaba-druid-1.0/library/build.gradle.kts index eabe5aaed0..bc6ff46a63 100644 --- a/instrumentation/alibaba-druid-1.0/library/build.gradle.kts +++ b/instrumentation/alibaba-druid-1.0/library/build.gradle.kts @@ -9,22 +9,14 @@ dependencies { testImplementation(project(":instrumentation:alibaba-druid-1.0:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/apache-dbcp-2.0/javaagent/build.gradle.kts b/instrumentation/apache-dbcp-2.0/javaagent/build.gradle.kts index 4b76fcd0b0..1963fec28b 100644 --- a/instrumentation/apache-dbcp-2.0/javaagent/build.gradle.kts +++ b/instrumentation/apache-dbcp-2.0/javaagent/build.gradle.kts @@ -21,28 +21,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/apache-dbcp-2.0/library/build.gradle.kts b/instrumentation/apache-dbcp-2.0/library/build.gradle.kts index 661412dff5..eb7afb1d91 100644 --- a/instrumentation/apache-dbcp-2.0/library/build.gradle.kts +++ b/instrumentation/apache-dbcp-2.0/library/build.gradle.kts @@ -9,22 +9,15 @@ dependencies { testImplementation(project(":instrumentation:apache-dbcp-2.0:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts index 17cc806954..e537f915e0 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts +++ b/instrumentation/aws-sdk/aws-sdk-1.11/javaagent/build.gradle.kts @@ -128,18 +128,6 @@ testing { } } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -166,6 +154,19 @@ tasks { jvmArgs("-Dotel.instrumentation.aws-sdk.experimental-span-attributes=true") systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) } + + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + + check { + dependsOn(testStableSemconv) + } } if (!(findProperty("testLatestDeps") as Boolean)) { diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts index ead9d66b49..f210d0e791 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library-autoconfigure/build.gradle.kts @@ -23,29 +23,22 @@ dependencies { latestDepTestLibrary("com.amazonaws:aws-java-sdk-sqs:1.12.583") // documented limitation } -testing { - suites { - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("SqsSuppressReceiveSpansTest") - } - include("**/SqsSuppressReceiveSpansTest.*") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", "true") systemProperty("otel.instrumentation.messaging.experimental.capture-headers", "Test-Message-Header") } + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("SqsSuppressReceiveSpansTest") + } + include("**/SqsSuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("SqsSuppressReceiveSpansTest") @@ -54,7 +47,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testReceiveSpansDisabled) } } diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts index b368bcc6b2..1ccae1d21c 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts @@ -48,21 +48,17 @@ testing { implementation("com.amazonaws:aws-java-sdk-secretsmanager:$version") } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/javaagent/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-2.2/javaagent/build.gradle.kts index 31ea08e06e..5411f353f5 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/javaagent/build.gradle.kts +++ b/instrumentation/aws-sdk/aws-sdk-2.2/javaagent/build.gradle.kts @@ -171,53 +171,40 @@ testing { } } -testing { - suites { - val testExperimentalSqs by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - excludeTestsMatching("Aws2SqsSuppressReceiveSpansTest") - } - systemProperty("otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", "true") - systemProperty("otel.instrumentation.messaging.experimental.receive-telemetry.enabled", "true") - } - } - } - } - - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Aws2SqsSuppressReceiveSpansTest") - } - include("**/Aws2SqsSuppressReceiveSpansTest.*") - } - } - } - } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - excludeTestsMatching("Aws2SqsSuppressReceiveSpansTest") - } - systemProperty("otel.instrumentation.messaging.experimental.receive-telemetry.enabled", "true") - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testExperimentalSqs by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + excludeTestsMatching("Aws2SqsSuppressReceiveSpansTest") + } + systemProperty("otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", "true") + systemProperty("otel.instrumentation.messaging.experimental.receive-telemetry.enabled", "true") + } + + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("Aws2SqsSuppressReceiveSpansTest") + } + include("**/Aws2SqsSuppressReceiveSpansTest.*") + } + + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + excludeTestsMatching("Aws2SqsSuppressReceiveSpansTest") + } + systemProperty("otel.instrumentation.messaging.experimental.receive-telemetry.enabled", "true") + jvmArgs("-Dotel.semconv-stability.opt-in=database") + + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } test { filter { @@ -228,7 +215,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testing.suites, testExperimentalSqs, testStableSemconv, testReceiveSpansDisabled) } withType().configureEach { diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/build.gradle.kts index e3592e0c4a..54daa03f7e 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/build.gradle.kts +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library-autoconfigure/build.gradle.kts @@ -24,20 +24,6 @@ dependencies { testLibrary("software.amazon.awssdk:sqs:2.2.0") } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", true) @@ -46,7 +32,14 @@ tasks { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/aws-sdk/aws-sdk-2.2/library/build.gradle.kts b/instrumentation/aws-sdk/aws-sdk-2.2/library/build.gradle.kts index 296527cf53..a44678d8d2 100644 --- a/instrumentation/aws-sdk/aws-sdk-2.2/library/build.gradle.kts +++ b/instrumentation/aws-sdk/aws-sdk-2.2/library/build.gradle.kts @@ -66,16 +66,6 @@ testing { implementation("software.amazon.awssdk:bedrockruntime:$version") } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -87,7 +77,14 @@ tasks { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/c3p0-0.9/javaagent/build.gradle.kts b/instrumentation/c3p0-0.9/javaagent/build.gradle.kts index 532f5c1d61..fe931a40ab 100644 --- a/instrumentation/c3p0-0.9/javaagent/build.gradle.kts +++ b/instrumentation/c3p0-0.9/javaagent/build.gradle.kts @@ -23,28 +23,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/c3p0-0.9/library/build.gradle.kts b/instrumentation/c3p0-0.9/library/build.gradle.kts index 248eb45d9d..8624b977a5 100644 --- a/instrumentation/c3p0-0.9/library/build.gradle.kts +++ b/instrumentation/c3p0-0.9/library/build.gradle.kts @@ -9,22 +9,15 @@ dependencies { testImplementation(project(":instrumentation:c3p0-0.9:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/camel-2.20/javaagent/build.gradle.kts b/instrumentation/camel-2.20/javaagent/build.gradle.kts index 640dabf884..d6df3d8e63 100644 --- a/instrumentation/camel-2.20/javaagent/build.gradle.kts +++ b/instrumentation/camel-2.20/javaagent/build.gradle.kts @@ -67,32 +67,6 @@ dependencies { latestDepTestLibrary("org.apache.camel:camel-cassandraql:2.+") // documented limitation } -testing { - suites { - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.camel.experimental-span-attributes=true") - systemProperty("metadataConfig", "otel.instrumentation.camel.experimental-span-attributes=true") - } - } - } - } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { jvmArgs("-Dotel.instrumentation.aws-sdk.experimental-span-attributes=true") @@ -109,8 +83,24 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.instrumentation.camel.experimental-span-attributes=true") + systemProperty("metadataConfig", "otel.instrumentation.camel.experimental-span-attributes=true") + } + + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv, testExperimental) } } diff --git a/instrumentation/cassandra/cassandra-3.0/javaagent/build.gradle.kts b/instrumentation/cassandra/cassandra-3.0/javaagent/build.gradle.kts index 16afb935a9..e09e209b9b 100644 --- a/instrumentation/cassandra/cassandra-3.0/javaagent/build.gradle.kts +++ b/instrumentation/cassandra/cassandra-3.0/javaagent/build.gradle.kts @@ -40,28 +40,21 @@ dependencies { // Requires old Guava. Can't use enforcedPlatform since predates BOM configurations.testRuntimeClasspath.get().resolutionStrategy.force("com.google.guava:guava:19.0") -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/cassandra/cassandra-4.0/javaagent/build.gradle.kts b/instrumentation/cassandra/cassandra-4.0/javaagent/build.gradle.kts index 69deb88d64..2ccb1fda9e 100644 --- a/instrumentation/cassandra/cassandra-4.0/javaagent/build.gradle.kts +++ b/instrumentation/cassandra/cassandra-4.0/javaagent/build.gradle.kts @@ -23,28 +23,21 @@ dependencies { testInstrumentation(project(":instrumentation:cassandra:cassandra-4.4:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/cassandra/cassandra-4.4/javaagent/build.gradle.kts b/instrumentation/cassandra/cassandra-4.4/javaagent/build.gradle.kts index a701a68d1a..5f310ed606 100644 --- a/instrumentation/cassandra/cassandra-4.4/javaagent/build.gradle.kts +++ b/instrumentation/cassandra/cassandra-4.4/javaagent/build.gradle.kts @@ -26,28 +26,21 @@ dependencies { testInstrumentation(project(":instrumentation:cassandra:cassandra-4.0:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/cassandra/cassandra-4.4/library/build.gradle.kts b/instrumentation/cassandra/cassandra-4.4/library/build.gradle.kts index 891a5bfb4d..13a5a80373 100644 --- a/instrumentation/cassandra/cassandra-4.4/library/build.gradle.kts +++ b/instrumentation/cassandra/cassandra-4.4/library/build.gradle.kts @@ -11,26 +11,18 @@ dependencies { testImplementation(project(":instrumentation:cassandra:cassandra-4.4:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/clickhouse-client-0.5/javaagent/build.gradle.kts b/instrumentation/clickhouse-client-0.5/javaagent/build.gradle.kts index 492158ee0d..d15e3af9b0 100644 --- a/instrumentation/clickhouse-client-0.5/javaagent/build.gradle.kts +++ b/instrumentation/clickhouse-client-0.5/javaagent/build.gradle.kts @@ -22,31 +22,21 @@ dependencies { testLibrary("org.apache.httpcomponents.client5:httpclient5:5.2.3") } -val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" - -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - } - } - } - } - } -} - tasks { - test { + withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) - systemProperty("collectMetadata", collectMetadata) + systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") + } + + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/couchbase/couchbase-2.0/javaagent/build.gradle.kts b/instrumentation/couchbase/couchbase-2.0/javaagent/build.gradle.kts index 3ec412aef2..a404912c99 100644 --- a/instrumentation/couchbase/couchbase-2.0/javaagent/build.gradle.kts +++ b/instrumentation/couchbase/couchbase-2.0/javaagent/build.gradle.kts @@ -30,21 +30,6 @@ dependencies { latestDepTestLibrary("com.couchbase.client:java-client:2.5.+") // see couchbase-2.6 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // required on jdk17 @@ -55,7 +40,15 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/couchbase/couchbase-2.6/javaagent/build.gradle.kts b/instrumentation/couchbase/couchbase-2.6/javaagent/build.gradle.kts index 82efe330e1..0c9e93ccd4 100644 --- a/instrumentation/couchbase/couchbase-2.6/javaagent/build.gradle.kts +++ b/instrumentation/couchbase/couchbase-2.6/javaagent/build.gradle.kts @@ -33,32 +33,6 @@ dependencies { latestDepTestLibrary("com.couchbase.client:java-client:2.+") // see couchbase-3.1 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.couchbase.experimental-span-attributes=true") - systemProperty("metadataConfig", "otel.instrumentation.couchbase.experimental-span-attributes=true") - } - } - } - } - } -} - tasks { withType().configureEach { // required on jdk17 @@ -68,7 +42,23 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.instrumentation.couchbase.experimental-span-attributes=true") + systemProperty("metadataConfig", "otel.instrumentation.couchbase.experimental-span-attributes=true") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv, testExperimental) } } diff --git a/instrumentation/couchbase/couchbase-3.1.6/javaagent/build.gradle.kts b/instrumentation/couchbase/couchbase-3.1.6/javaagent/build.gradle.kts index ec47a67d44..e337e431d3 100644 --- a/instrumentation/couchbase/couchbase-3.1.6/javaagent/build.gradle.kts +++ b/instrumentation/couchbase/couchbase-3.1.6/javaagent/build.gradle.kts @@ -38,26 +38,19 @@ dependencies { latestDepTestLibrary("com.couchbase.client:java-client:3.1.+") // see couchbase-3.2 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/couchbase/couchbase-3.1/javaagent/build.gradle.kts b/instrumentation/couchbase/couchbase-3.1/javaagent/build.gradle.kts index aab8adb7ea..f4b2de4e97 100644 --- a/instrumentation/couchbase/couchbase-3.1/javaagent/build.gradle.kts +++ b/instrumentation/couchbase/couchbase-3.1/javaagent/build.gradle.kts @@ -39,26 +39,18 @@ dependencies { latestDepTestLibrary("com.couchbase.client:java-client:3.1.5") // see couchbase-3.1.6 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/couchbase/couchbase-3.2/javaagent/build.gradle.kts b/instrumentation/couchbase/couchbase-3.2/javaagent/build.gradle.kts index 08f2594eac..8da259c087 100644 --- a/instrumentation/couchbase/couchbase-3.2/javaagent/build.gradle.kts +++ b/instrumentation/couchbase/couchbase-3.2/javaagent/build.gradle.kts @@ -36,27 +36,20 @@ dependencies { testImplementation("org.testcontainers:couchbase") } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/build.gradle.kts b/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/build.gradle.kts index d2ba58a8e3..aba169d324 100644 --- a/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/build.gradle.kts +++ b/instrumentation/elasticsearch/elasticsearch-api-client-7.16/javaagent/build.gradle.kts @@ -70,17 +70,6 @@ testing { } } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -92,7 +81,15 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent/build.gradle.kts b/instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent/build.gradle.kts index 28c6c06862..2fb1d5df5d 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent/build.gradle.kts +++ b/instrumentation/elasticsearch/elasticsearch-rest-5.0/javaagent/build.gradle.kts @@ -35,21 +35,6 @@ dependencies { latestDepTestLibrary("org.elasticsearch.client:elasticsearch-rest-client:6.3.+") // see elasticsearch-rest-6.4 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) @@ -58,7 +43,15 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent/build.gradle.kts b/instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent/build.gradle.kts index 1944cff02e..072b1bb10e 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent/build.gradle.kts +++ b/instrumentation/elasticsearch/elasticsearch-rest-6.4/javaagent/build.gradle.kts @@ -35,28 +35,21 @@ dependencies { latestDepTestLibrary("org.elasticsearch.client:elasticsearch-rest-client:6.+") // see elasticsearch-rest-7.0 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent/build.gradle.kts b/instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent/build.gradle.kts index df312461fe..dc79d9c89a 100644 --- a/instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent/build.gradle.kts +++ b/instrumentation/elasticsearch/elasticsearch-rest-7.0/javaagent/build.gradle.kts @@ -38,21 +38,6 @@ dependencies { testImplementation("org.testcontainers:elasticsearch") } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) @@ -61,7 +46,15 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/build.gradle.kts b/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/build.gradle.kts index 3b63620de0..53ce0034ef 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/build.gradle.kts +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.0/javaagent/build.gradle.kts @@ -49,32 +49,6 @@ dependencies { latestDepTestLibrary("org.elasticsearch.client:transport:5.2.+") // see elasticsearch-transport-5.3 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true") - systemProperty("metadataConfig", "otel.instrumentation.elasticsearch.experimental-span-attributes=true") - } - } - } - } - } -} - tasks { withType().configureEach { // required on jdk17 @@ -83,7 +57,23 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true") + systemProperty("metadataConfig", "otel.instrumentation.elasticsearch.experimental-span-attributes=true") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv, testExperimental) } } diff --git a/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts b/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts index f233caf542..321b531d96 100644 --- a/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts +++ b/instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts @@ -65,32 +65,6 @@ dependencies { latestDepTestLibrary("org.springframework.data:spring-data-elasticsearch:3.0.+") // see elasticsearch-transport-6.0 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database,code") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true") - systemProperty("metadataConfig", "otel.instrumentation.elasticsearch.experimental-span-attributes=true") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) @@ -102,7 +76,23 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database,code") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true") + systemProperty("metadataConfig", "otel.instrumentation.elasticsearch.experimental-span-attributes=true") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv, testExperimental) } } diff --git a/instrumentation/external-annotations/javaagent/build.gradle.kts b/instrumentation/external-annotations/javaagent/build.gradle.kts index 5e31e055aa..86111211c8 100644 --- a/instrumentation/external-annotations/javaagent/build.gradle.kts +++ b/instrumentation/external-annotations/javaagent/build.gradle.kts @@ -34,41 +34,31 @@ dependencies { testCompileOnly("org.springframework:spring-core:4.3.30.RELEASE") } -testing { - suites { - val testIncludeProperty by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("ConfiguredTraceAnnotationsTest") - } - include("**/ConfiguredTraceAnnotationsTest.*") - jvmArgs("-Dotel.instrumentation.external-annotations.include=io.opentelemetry.javaagent.instrumentation.extannotations.OuterClass\$InterestingMethod") - } - } - } - } - - val testExcludeMethodsProperty by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("TracedMethodsExclusionTest") - } - include("**/TracedMethodsExclusionTest.*") - jvmArgs( - "-Dotel.instrumentation.external-annotations.exclude-methods=io.opentelemetry.javaagent.instrumentation.extannotations.TracedMethodsExclusionTest\$TestClass[excluded,annotatedButExcluded]" - ) - } - } - } - } - } -} - tasks { + val testIncludeProperty by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("ConfiguredTraceAnnotationsTest") + } + include("**/ConfiguredTraceAnnotationsTest.*") + jvmArgs("-Dotel.instrumentation.external-annotations.include=io.opentelemetry.javaagent.instrumentation.extannotations.OuterClass\$InterestingMethod") + } + + val testExcludeMethodsProperty by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("TracedMethodsExclusionTest") + } + include("**/TracedMethodsExclusionTest.*") + jvmArgs( + "-Dotel.instrumentation.external-annotations.exclude-methods=io.opentelemetry.javaagent.instrumentation.extannotations.TracedMethodsExclusionTest\$TestClass[excluded,annotatedButExcluded]" + ) + } + test { filter { excludeTestsMatching("ConfiguredTraceAnnotationsTest") @@ -77,6 +67,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testIncludeProperty, testExcludeMethodsProperty) } } diff --git a/instrumentation/geode-1.4/javaagent/build.gradle.kts b/instrumentation/geode-1.4/javaagent/build.gradle.kts index 7b61520802..32e606d2b1 100644 --- a/instrumentation/geode-1.4/javaagent/build.gradle.kts +++ b/instrumentation/geode-1.4/javaagent/build.gradle.kts @@ -19,28 +19,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/graphql-java/graphql-java-20.0/javaagent/build.gradle.kts b/instrumentation/graphql-java/graphql-java-20.0/javaagent/build.gradle.kts index fd8a66a0f6..d9fb4776f0 100644 --- a/instrumentation/graphql-java/graphql-java-20.0/javaagent/build.gradle.kts +++ b/instrumentation/graphql-java/graphql-java-20.0/javaagent/build.gradle.kts @@ -23,29 +23,22 @@ dependencies { testImplementation(project(":instrumentation:graphql-java:graphql-java-common:testing")) } -testing { - suites { - val testDataFetcher by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.graphql.data-fetcher.enabled=true") - systemProperty("metadataConfig", "otel.instrumentation.graphql.data-fetcher.enabled=true") - } - } - } - } - } -} - tasks { withType().configureEach { jvmArgs("-Dotel.instrumentation.graphql.add-operation-name-to-span-name.enabled=true") systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testDataFetcher by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.instrumentation.graphql.data-fetcher.enabled=true") + systemProperty("metadataConfig", "otel.instrumentation.graphql.data-fetcher.enabled=true") + } + check { - dependsOn(testing.suites) + dependsOn(testDataFetcher) } } diff --git a/instrumentation/guava-10.0/javaagent/build.gradle.kts b/instrumentation/guava-10.0/javaagent/build.gradle.kts index 10cb75f392..57c6bfc7b0 100644 --- a/instrumentation/guava-10.0/javaagent/build.gradle.kts +++ b/instrumentation/guava-10.0/javaagent/build.gradle.kts @@ -32,32 +32,22 @@ dependencies { testImplementation("io.opentelemetry:opentelemetry-extension-annotations") } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code") - } - } - } - } - - val testBothSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=code") + } + + val testBothSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv, testBothSemconv) } } diff --git a/instrumentation/hibernate/hibernate-3.3/javaagent/build.gradle.kts b/instrumentation/hibernate/hibernate-3.3/javaagent/build.gradle.kts index 404a97d538..e9a12fa4a8 100644 --- a/instrumentation/hibernate/hibernate-3.3/javaagent/build.gradle.kts +++ b/instrumentation/hibernate/hibernate-3.3/javaagent/build.gradle.kts @@ -48,20 +48,6 @@ if (findProperty("testLatestDeps") as Boolean) { } } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // TODO run tests both with and without experimental span attributes @@ -71,7 +57,14 @@ tasks { jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/hibernate/hibernate-4.0/javaagent/build.gradle.kts b/instrumentation/hibernate/hibernate-4.0/javaagent/build.gradle.kts index e2513ad662..a8eeb5ba36 100644 --- a/instrumentation/hibernate/hibernate-4.0/javaagent/build.gradle.kts +++ b/instrumentation/hibernate/hibernate-4.0/javaagent/build.gradle.kts @@ -68,16 +68,6 @@ testing { } } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -94,7 +84,14 @@ tasks { jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/hibernate/hibernate-6.0/javaagent/build.gradle.kts b/instrumentation/hibernate/hibernate-6.0/javaagent/build.gradle.kts index 0f4e63a66c..d18f8904e8 100644 --- a/instrumentation/hibernate/hibernate-6.0/javaagent/build.gradle.kts +++ b/instrumentation/hibernate/hibernate-6.0/javaagent/build.gradle.kts @@ -62,16 +62,6 @@ testing { } } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -93,7 +83,14 @@ tasks { } } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/hibernate/hibernate-6.0/spring-testing/build.gradle.kts b/instrumentation/hibernate/hibernate-6.0/spring-testing/build.gradle.kts index d1a7e48ebb..fa25ca965b 100644 --- a/instrumentation/hibernate/hibernate-6.0/spring-testing/build.gradle.kts +++ b/instrumentation/hibernate/hibernate-6.0/spring-testing/build.gradle.kts @@ -24,20 +24,6 @@ otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { jvmArgs("-javaagent:" + springAgent.singleFile.absolutePath) @@ -48,7 +34,14 @@ tasks { jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/build.gradle.kts b/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/build.gradle.kts index 948f0b5fa2..6b95ed61ff 100644 --- a/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/build.gradle.kts +++ b/instrumentation/hibernate/hibernate-procedure-call-4.3/javaagent/build.gradle.kts @@ -31,27 +31,20 @@ dependencies { latestDepTestLibrary("org.hibernate:hibernate-entitymanager:5.+") // documented limitation } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // TODO run tests both with and without experimental span attributes jvmArgs("-Dotel.instrumentation.hibernate.experimental-span-attributes=true") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/hibernate/hibernate-reactive-1.0/javaagent/build.gradle.kts b/instrumentation/hibernate/hibernate-reactive-1.0/javaagent/build.gradle.kts index eb56e53288..45634ff761 100644 --- a/instrumentation/hibernate/hibernate-reactive-1.0/javaagent/build.gradle.kts +++ b/instrumentation/hibernate/hibernate-reactive-1.0/javaagent/build.gradle.kts @@ -72,16 +72,6 @@ testing { compileOnly("io.vertx:vertx-codegen:4.4.2") } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -114,8 +104,15 @@ tasks { } } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/hikaricp-3.0/javaagent/build.gradle.kts b/instrumentation/hikaricp-3.0/javaagent/build.gradle.kts index 40ea6d8786..8a1ab5bd64 100644 --- a/instrumentation/hikaricp-3.0/javaagent/build.gradle.kts +++ b/instrumentation/hikaricp-3.0/javaagent/build.gradle.kts @@ -24,28 +24,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/hikaricp-3.0/library/build.gradle.kts b/instrumentation/hikaricp-3.0/library/build.gradle.kts index 4de9c1dbac..5dee323256 100644 --- a/instrumentation/hikaricp-3.0/library/build.gradle.kts +++ b/instrumentation/hikaricp-3.0/library/build.gradle.kts @@ -9,22 +9,15 @@ dependencies { testImplementation(project(":instrumentation:hikaricp-3.0:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/influxdb-2.4/javaagent/build.gradle.kts b/instrumentation/influxdb-2.4/javaagent/build.gradle.kts index 4d2c924468..7274caea65 100644 --- a/instrumentation/influxdb-2.4/javaagent/build.gradle.kts +++ b/instrumentation/influxdb-2.4/javaagent/build.gradle.kts @@ -32,16 +32,6 @@ testing { implementation("org.testcontainers:testcontainers") } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -59,7 +49,14 @@ tasks { } } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/jdbc/javaagent/build.gradle.kts b/instrumentation/jdbc/javaagent/build.gradle.kts index 1798a74b71..56308493f1 100644 --- a/instrumentation/jdbc/javaagent/build.gradle.kts +++ b/instrumentation/jdbc/javaagent/build.gradle.kts @@ -54,66 +54,50 @@ sourceSets { } } -testing { - suites { - val testSlick by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("SlickTest") - } - include("**/SlickTest.*") - } - } - } - } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - excludeTestsMatching("SlickTest") - excludeTestsMatching("PreparedStatementParametersTest") - } - jvmArgs("-Dotel.instrumentation.jdbc-datasource.enabled=true") - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - - val testSlickStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("SlickTest") - } - include("**/SlickTest.*") - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - - val testCaptureParameters by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("PreparedStatementParametersTest") - } - jvmArgs("-Dotel.instrumentation.jdbc.experimental.capture-query-parameters=true") - } - } - } - } - } -} - tasks { + val testSlick by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("SlickTest") + } + include("**/SlickTest.*") + } + + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + excludeTestsMatching("SlickTest") + excludeTestsMatching("PreparedStatementParametersTest") + } + jvmArgs("-Dotel.instrumentation.jdbc-datasource.enabled=true") + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + + val testSlickStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("SlickTest") + } + include("**/SlickTest.*") + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + + val testCaptureParameters by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("PreparedStatementParametersTest") + } + jvmArgs("-Dotel.instrumentation.jdbc.experimental.capture-query-parameters=true") + } + test { filter { excludeTestsMatching("SlickTest") @@ -123,7 +107,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testSlick, testStableSemconv, testSlickStableSemconv, testCaptureParameters) } } diff --git a/instrumentation/jdbc/library/build.gradle.kts b/instrumentation/jdbc/library/build.gradle.kts index dd3e7e1d0e..3c3246102f 100644 --- a/instrumentation/jdbc/library/build.gradle.kts +++ b/instrumentation/jdbc/library/build.gradle.kts @@ -15,20 +15,6 @@ dependencies { testImplementation(project(":instrumentation:jdbc:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { // We cannot use "--release" javac option here because that will forbid using apis that were added // in later versions. In JDBC wrappers we wish to implement delegation for methods that are not @@ -65,8 +51,15 @@ tasks { include("io/opentelemetry/javaagent/bootstrap/**") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts b/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts index 10a8690636..8fc19ca3fe 100644 --- a/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts +++ b/instrumentation/jedis/jedis-1.4/javaagent/build.gradle.kts @@ -35,16 +35,6 @@ testing { implementation(project(":instrumentation:jedis:jedis-1.4:testing")) } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -53,7 +43,14 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts b/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts index 323924da13..8379c56294 100644 --- a/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts +++ b/instrumentation/jedis/jedis-3.0/javaagent/build.gradle.kts @@ -28,26 +28,19 @@ dependencies { latestDepTestLibrary("redis.clients:jedis:3.+") // see jedis-4.0 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts b/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts index 12f7f754df..34293541c6 100644 --- a/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts +++ b/instrumentation/jedis/jedis-4.0/javaagent/build.gradle.kts @@ -24,20 +24,6 @@ dependencies { testInstrumentation(project(":instrumentation:jedis:jedis-3.0:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // latest dep test fails because peer ip is 0:0:0:0:0:0:0:1 instead of 127.0.0.1 @@ -45,7 +31,14 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/jms/jms-1.1/javaagent/build.gradle.kts b/instrumentation/jms/jms-1.1/javaagent/build.gradle.kts index b19737506f..a7d88a8ab6 100644 --- a/instrumentation/jms/jms-1.1/javaagent/build.gradle.kts +++ b/instrumentation/jms/jms-1.1/javaagent/build.gradle.kts @@ -45,19 +45,6 @@ testing { } } } - - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Jms1SuppressReceiveSpansTest") - } - include("**/Jms1SuppressReceiveSpansTest.*") - } - } - } - } } } @@ -66,6 +53,16 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("Jms1SuppressReceiveSpansTest") + } + include("**/Jms1SuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("Jms1SuppressReceiveSpansTest") @@ -74,7 +71,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testing.suites, testReceiveSpansDisabled) } } diff --git a/instrumentation/jms/jms-3.0/javaagent/build.gradle.kts b/instrumentation/jms/jms-3.0/javaagent/build.gradle.kts index 7295ffc658..b4da635222 100644 --- a/instrumentation/jms/jms-3.0/javaagent/build.gradle.kts +++ b/instrumentation/jms/jms-3.0/javaagent/build.gradle.kts @@ -29,23 +29,6 @@ dependencies { testImplementation("org.apache.activemq:artemis-jakarta-client:2.27.1") } -testing { - suites { - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Jms3SuppressReceiveSpansTest") - } - include("**/Jms3SuppressReceiveSpansTest.*") - } - } - } - } - } -} - otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_11) } @@ -55,6 +38,16 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + + filter { + includeTestsMatching("Jms3SuppressReceiveSpansTest") + } + include("**/Jms3SuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("Jms3SuppressReceiveSpansTest") @@ -63,6 +56,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testing.suites, testReceiveSpansDisabled) } } diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagent/build.gradle.kts b/instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagent/build.gradle.kts index 3ced86727f..60fc215f66 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagent/build.gradle.kts +++ b/instrumentation/kafka/kafka-clients/kafka-clients-0.11/javaagent/build.gradle.kts @@ -25,37 +25,6 @@ dependencies { testImplementation(project(":instrumentation:kafka:kafka-clients:kafka-clients-0.11:testing")) } -testing { - suites { - val testPropagationDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("KafkaClientPropagationDisabledTest") - } - include("**/KafkaClientPropagationDisabledTest.*") - jvmArgs("-Dotel.instrumentation.kafka.producer-propagation.enabled=false") - } - } - } - } - - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("KafkaClientSuppressReceiveSpansTest") - } - include("**/KafkaClientSuppressReceiveSpansTest.*") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) @@ -66,6 +35,25 @@ tasks { jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true") } + val testPropagationDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("KafkaClientPropagationDisabledTest") + } + include("**/KafkaClientPropagationDisabledTest.*") + jvmArgs("-Dotel.instrumentation.kafka.producer-propagation.enabled=false") + } + + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("KafkaClientSuppressReceiveSpansTest") + } + include("**/KafkaClientSuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("KafkaClientPropagationDisabledTest") @@ -75,6 +63,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testPropagationDisabled, testReceiveSpansDisabled) } } diff --git a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/build.gradle.kts b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/build.gradle.kts index 8e4469bc02..df75c599d2 100644 --- a/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/build.gradle.kts +++ b/instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/build.gradle.kts @@ -16,30 +16,22 @@ dependencies { testAnnotationProcessor("com.google.auto.value:auto-value") } -testing { - suites { - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("InterceptorsSuppressReceiveSpansTest") - includeTestsMatching("WrapperSuppressReceiveSpansTest") - } - include("**/InterceptorsSuppressReceiveSpansTest.*", "**/WrapperSuppressReceiveSpansTest.*") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) } + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("InterceptorsSuppressReceiveSpansTest") + includeTestsMatching("WrapperSuppressReceiveSpansTest") + } + include("**/InterceptorsSuppressReceiveSpansTest.*", "**/WrapperSuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("InterceptorsSuppressReceiveSpansTest") @@ -50,6 +42,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testReceiveSpansDisabled) } } diff --git a/instrumentation/kafka/kafka-streams-0.11/javaagent/build.gradle.kts b/instrumentation/kafka/kafka-streams-0.11/javaagent/build.gradle.kts index cf56674476..3f2e53523a 100644 --- a/instrumentation/kafka/kafka-streams-0.11/javaagent/build.gradle.kts +++ b/instrumentation/kafka/kafka-streams-0.11/javaagent/build.gradle.kts @@ -23,23 +23,6 @@ dependencies { testImplementation("org.testcontainers:kafka") } -testing { - suites { - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("KafkaStreamsSuppressReceiveSpansTest") - } - include("**/KafkaStreamsSuppressReceiveSpansTest.*") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) @@ -50,6 +33,15 @@ tasks { jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true") } + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("KafkaStreamsSuppressReceiveSpansTest") + } + include("**/KafkaStreamsSuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("KafkaStreamsSuppressReceiveSpansTest") @@ -58,6 +50,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testReceiveSpansDisabled) } } diff --git a/instrumentation/lettuce/lettuce-4.0/javaagent/build.gradle.kts b/instrumentation/lettuce/lettuce-4.0/javaagent/build.gradle.kts index 0a6ddcb93a..945cf6d619 100644 --- a/instrumentation/lettuce/lettuce-4.0/javaagent/build.gradle.kts +++ b/instrumentation/lettuce/lettuce-4.0/javaagent/build.gradle.kts @@ -17,20 +17,6 @@ dependencies { latestDepTestLibrary("biz.paluch.redis:lettuce:4.+") // see lettuce-5.0 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // TODO run tests both with and without experimental span attributes @@ -39,7 +25,13 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/lettuce/lettuce-5.0/javaagent/build.gradle.kts b/instrumentation/lettuce/lettuce-5.0/javaagent/build.gradle.kts index 890ab4b4eb..a97763c59a 100644 --- a/instrumentation/lettuce/lettuce-5.0/javaagent/build.gradle.kts +++ b/instrumentation/lettuce/lettuce-5.0/javaagent/build.gradle.kts @@ -24,20 +24,6 @@ dependencies { latestDepTestLibrary("io.lettuce:lettuce-core:5.0.+") // see lettuce-5.1 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // TODO run tests both with and without experimental span attributes @@ -46,7 +32,13 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/lettuce/lettuce-5.1/javaagent/build.gradle.kts b/instrumentation/lettuce/lettuce-5.1/javaagent/build.gradle.kts index ff9ff2cfed..014f750bb2 100644 --- a/instrumentation/lettuce/lettuce-5.1/javaagent/build.gradle.kts +++ b/instrumentation/lettuce/lettuce-5.1/javaagent/build.gradle.kts @@ -23,27 +23,19 @@ dependencies { testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/lettuce/lettuce-5.1/library/build.gradle.kts b/instrumentation/lettuce/lettuce-5.1/library/build.gradle.kts index 79a61eb760..d3a5268779 100644 --- a/instrumentation/lettuce/lettuce-5.1/library/build.gradle.kts +++ b/instrumentation/lettuce/lettuce-5.1/library/build.gradle.kts @@ -12,27 +12,19 @@ dependencies { testImplementation(project(":instrumentation:reactor:reactor-3.1:library")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts b/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts index 9bcc16c99c..09ab724ab3 100644 --- a/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts @@ -45,23 +45,15 @@ tasks.withType().configureEach { systemProperty("testLatestDeps", testLatestDeps) } -testing { - suites { - val testAsync by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector") - } - } - } - } - } -} - tasks { + val testAsync by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector") + } + check { - dependsOn(testing.suites) + dependsOn(testAsync) } } diff --git a/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts b/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts index 1bb4c588c9..b462fb694f 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts @@ -17,47 +17,31 @@ dependencies { } } -testing { - suites { - val testAsyncLogger by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector") - } - } - } - } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code") - } - } - } - } - - val testBothSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") } + val testAsyncLogger by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector") + } + + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code") + } + + val testBothSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") + } + check { - dependsOn(testing.suites) + dependsOn(testAsyncLogger, testStableSemconv, testBothSemconv) } } diff --git a/instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/build.gradle.kts b/instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/build.gradle.kts index fb16efc3c5..531ed79bcf 100644 --- a/instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/build.gradle.kts +++ b/instrumentation/log4j/log4j-context-data/log4j-context-data-2.17/library-autoconfigure/build.gradle.kts @@ -11,38 +11,6 @@ dependencies { testImplementation(project(":instrumentation:log4j:log4j-context-data:log4j-context-data-common:testing")) } -testing { - suites { - val testAddBaggage by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("LibraryLog4j2BaggageTest") - } - jvmArgs("-Dotel.instrumentation.log4j-context-data.add-baggage=true") - } - } - } - } - - val testLoggingKeys by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("LibraryLog4j2LoggingKeysTest") - } - jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test") - jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test") - jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test") - } - } - } - } - } -} - tasks { test { filter { @@ -51,7 +19,27 @@ tasks { } } + val testAddBaggage by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("LibraryLog4j2BaggageTest") + } + jvmArgs("-Dotel.instrumentation.log4j-context-data.add-baggage=true") + } + + val testLoggingKeys by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("LibraryLog4j2LoggingKeysTest") + } + jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test") + jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test") + jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test") + } + named("check") { - dependsOn(testing.suites) + dependsOn(testAddBaggage, testLoggingKeys) } } diff --git a/instrumentation/log4j/log4j-context-data/log4j-context-data-2.7/javaagent/build.gradle.kts b/instrumentation/log4j/log4j-context-data/log4j-context-data-2.7/javaagent/build.gradle.kts index d2ccc1c9b6..01733c59db 100644 --- a/instrumentation/log4j/log4j-context-data/log4j-context-data-2.7/javaagent/build.gradle.kts +++ b/instrumentation/log4j/log4j-context-data/log4j-context-data-2.7/javaagent/build.gradle.kts @@ -21,38 +21,6 @@ dependencies { latestDepTestLibrary("org.apache.logging.log4j:log4j-core:2.16.+") // see log4j-context-data-2.17 module } -testing { - suites { - val testAddBaggage by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Log4j27BaggageTest") - } - jvmArgs("-Dotel.instrumentation.log4j-context-data.add-baggage=true") - } - } - } - } - - val testLoggingKeys by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Log4j27LoggingKeysTest") - } - jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test") - jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test") - jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test") - } - } - } - } - } -} - tasks { test { filter { @@ -62,7 +30,27 @@ tasks { jvmArgs("-Dotel.instrumentation.common.mdc.resource-attributes=service.name,telemetry.sdk.language") } + val testAddBaggage by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("Log4j27BaggageTest") + } + jvmArgs("-Dotel.instrumentation.log4j-context-data.add-baggage=true") + } + + val testLoggingKeys by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("Log4j27LoggingKeysTest") + } + jvmArgs("-Dotel.instrumentation.common.logging.trace-id=trace_id_test") + jvmArgs("-Dotel.instrumentation.common.logging.span-id=span_id_test") + jvmArgs("-Dotel.instrumentation.common.logging.trace-flags=trace_flags_test") + } + named("check") { - dependsOn(testing.suites) + dependsOn(testAddBaggage, testLoggingKeys) } } diff --git a/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts b/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts index c6d7dbe55b..aa24d42968 100644 --- a/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts +++ b/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts @@ -121,33 +121,25 @@ testing { } } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code") - } - } - } - } - - val testBothSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") - } - } - } - } } } tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code") + } + + val testBothSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv, testBothSemconv) } } diff --git a/instrumentation/micrometer/micrometer-1.5/javaagent/build.gradle.kts b/instrumentation/micrometer/micrometer-1.5/javaagent/build.gradle.kts index c7174bfecf..1ce775c670 100644 --- a/instrumentation/micrometer/micrometer-1.5/javaagent/build.gradle.kts +++ b/instrumentation/micrometer/micrometer-1.5/javaagent/build.gradle.kts @@ -19,53 +19,37 @@ dependencies { testImplementation(project(":instrumentation:micrometer:micrometer-1.5:testing")) } -testing { - suites { - val testPrometheusMode by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*PrometheusModeTest") - } - include("**/*PrometheusModeTest.*") - jvmArgs("-Dotel.instrumentation.micrometer.prometheus-mode.enabled=true") - } - } - } - } - - val testBaseTimeUnit by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*TimerMillisecondsTest") - } - include("**/*TimerMillisecondsTest.*") - jvmArgs("-Dotel.instrumentation.micrometer.base-time-unit=milliseconds") - } - } - } - } - - val testHistogramGauges by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*HistogramGaugesTest") - } - include("**/*HistogramGaugesTest.*") - jvmArgs("-Dotel.instrumentation.micrometer.histogram-gauges.enabled=true") - } - } - } - } - } -} - tasks { + val testPrometheusMode by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*PrometheusModeTest") + } + include("**/*PrometheusModeTest.*") + jvmArgs("-Dotel.instrumentation.micrometer.prometheus-mode.enabled=true") + } + + val testBaseTimeUnit by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*TimerMillisecondsTest") + } + include("**/*TimerMillisecondsTest.*") + jvmArgs("-Dotel.instrumentation.micrometer.base-time-unit=milliseconds") + } + + val testHistogramGauges by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*HistogramGaugesTest") + } + include("**/*HistogramGaugesTest.*") + jvmArgs("-Dotel.instrumentation.micrometer.histogram-gauges.enabled=true") + } + test { filter { excludeTestsMatching("*TimerMillisecondsTest") @@ -75,7 +59,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testBaseTimeUnit, testPrometheusMode, testHistogramGauges) } withType().configureEach { diff --git a/instrumentation/mongo/mongo-3.1/javaagent/build.gradle.kts b/instrumentation/mongo/mongo-3.1/javaagent/build.gradle.kts index 5ad0eb2b6f..6aae40ef67 100644 --- a/instrumentation/mongo/mongo-3.1/javaagent/build.gradle.kts +++ b/instrumentation/mongo/mongo-3.1/javaagent/build.gradle.kts @@ -23,26 +23,18 @@ dependencies { testInstrumentation(project(":instrumentation:mongo:mongo-4.0:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/mongo/mongo-3.1/library/build.gradle.kts b/instrumentation/mongo/mongo-3.1/library/build.gradle.kts index 24b38f4f60..dae94556bc 100644 --- a/instrumentation/mongo/mongo-3.1/library/build.gradle.kts +++ b/instrumentation/mongo/mongo-3.1/library/build.gradle.kts @@ -12,26 +12,18 @@ dependencies { testImplementation(project(":instrumentation:mongo:mongo-3.1:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/mongo/mongo-3.7/javaagent/build.gradle.kts b/instrumentation/mongo/mongo-3.7/javaagent/build.gradle.kts index 228534f3a6..705fb69ff0 100644 --- a/instrumentation/mongo/mongo-3.7/javaagent/build.gradle.kts +++ b/instrumentation/mongo/mongo-3.7/javaagent/build.gradle.kts @@ -33,26 +33,18 @@ dependencies { testInstrumentation(project(":instrumentation:mongo:mongo-4.0:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/mongo/mongo-4.0/javaagent/build.gradle.kts b/instrumentation/mongo/mongo-4.0/javaagent/build.gradle.kts index 55e2e54048..db3481d9a7 100644 --- a/instrumentation/mongo/mongo-4.0/javaagent/build.gradle.kts +++ b/instrumentation/mongo/mongo-4.0/javaagent/build.gradle.kts @@ -29,26 +29,18 @@ dependencies { testInstrumentation(project(":instrumentation:mongo:mongo-3.7:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/mongo/mongo-async-3.3/javaagent/build.gradle.kts b/instrumentation/mongo/mongo-async-3.3/javaagent/build.gradle.kts index cfb88c02e4..682a47f552 100644 --- a/instrumentation/mongo/mongo-async-3.3/javaagent/build.gradle.kts +++ b/instrumentation/mongo/mongo-async-3.3/javaagent/build.gradle.kts @@ -24,26 +24,18 @@ dependencies { testInstrumentation(project(":instrumentation:mongo:mongo-4.0:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/netty/netty-4.0/javaagent/build.gradle.kts b/instrumentation/netty/netty-4.0/javaagent/build.gradle.kts index d96ebf442f..48f1fa1371 100644 --- a/instrumentation/netty/netty-4.0/javaagent/build.gradle.kts +++ b/instrumentation/netty/netty-4.0/javaagent/build.gradle.kts @@ -35,27 +35,19 @@ dependencies { latestDepTestLibrary("io.netty:netty-codec-http:4.0.+") // see netty-4.1 module } -testing { - suites { - val testConnectionSpan by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Netty40ConnectionSpanTest") - includeTestsMatching("Netty40ClientSslTest") - } - include("**/Netty40ConnectionSpanTest.*", "**/Netty40ClientSslTest.*") - jvmArgs("-Dotel.instrumentation.netty.connection-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.netty.ssl-telemetry.enabled=true") - } - } - } - } - } -} - tasks { + val testConnectionSpan by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("Netty40ConnectionSpanTest") + includeTestsMatching("Netty40ClientSslTest") + } + include("**/Netty40ConnectionSpanTest.*", "**/Netty40ClientSslTest.*") + jvmArgs("-Dotel.instrumentation.netty.connection-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.netty.ssl-telemetry.enabled=true") + } + test { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") @@ -66,7 +58,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testConnectionSpan) } } diff --git a/instrumentation/netty/netty-4.1/javaagent/build.gradle.kts b/instrumentation/netty/netty-4.1/javaagent/build.gradle.kts index f317a7f4c6..f5a169a7cf 100644 --- a/instrumentation/netty/netty-4.1/javaagent/build.gradle.kts +++ b/instrumentation/netty/netty-4.1/javaagent/build.gradle.kts @@ -42,27 +42,19 @@ dependencies { testCompileOnly("io.netty:netty-transport-native-kqueue:4.1.11.Final:osx-x86_64") } -testing { - suites { - val testConnectionSpan by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("Netty41ConnectionSpanTest") - includeTestsMatching("Netty41ClientSslTest") - } - include("**/Netty41ConnectionSpanTest.*", "**/Netty41ClientSslTest.*") - jvmArgs("-Dotel.instrumentation.netty.connection-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.netty.ssl-telemetry.enabled=true") - } - } - } - } - } -} - tasks { + val testConnectionSpan by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("Netty41ConnectionSpanTest") + includeTestsMatching("Netty41ClientSslTest") + } + include("**/Netty41ConnectionSpanTest.*", "**/Netty41ClientSslTest.*") + jvmArgs("-Dotel.instrumentation.netty.connection-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.netty.ssl-telemetry.enabled=true") + } + test { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") @@ -74,7 +66,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testConnectionSpan) } } diff --git a/instrumentation/opensearch/opensearch-rest-1.0/javaagent/build.gradle.kts b/instrumentation/opensearch/opensearch-rest-1.0/javaagent/build.gradle.kts index 4ef485ec8f..ca8079bdcf 100644 --- a/instrumentation/opensearch/opensearch-rest-1.0/javaagent/build.gradle.kts +++ b/instrumentation/opensearch/opensearch-rest-1.0/javaagent/build.gradle.kts @@ -39,26 +39,18 @@ dependencies { latestDepTestLibrary("org.opensearch.client:opensearch-rest-client:2.+") // see opensearch-rest-3.0 module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { test { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/opensearch/opensearch-rest-3.0/javaagent/build.gradle.kts b/instrumentation/opensearch/opensearch-rest-3.0/javaagent/build.gradle.kts index 57c49fe08b..887daaf25f 100644 --- a/instrumentation/opensearch/opensearch-rest-3.0/javaagent/build.gradle.kts +++ b/instrumentation/opensearch/opensearch-rest-3.0/javaagent/build.gradle.kts @@ -32,26 +32,18 @@ dependencies { testImplementation(project(":instrumentation:opensearch:opensearch-rest-common:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { test { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/opentelemetry-instrumentation-api/javaagent/build.gradle.kts b/instrumentation/opentelemetry-instrumentation-api/javaagent/build.gradle.kts index cb39f07e92..7e2f7a7bd8 100644 --- a/instrumentation/opentelemetry-instrumentation-api/javaagent/build.gradle.kts +++ b/instrumentation/opentelemetry-instrumentation-api/javaagent/build.gradle.kts @@ -41,26 +41,6 @@ testing { implementation(project(":instrumentation:opentelemetry-instrumentation-api:testing")) } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code") - } - } - } - } - - val testBothSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") - } - } - } - } } } @@ -87,7 +67,19 @@ configurations.configureEach { tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code") + } + + val testBothSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv, testBothSemconv) } } diff --git a/instrumentation/oracle-ucp-11.2/javaagent/build.gradle.kts b/instrumentation/oracle-ucp-11.2/javaagent/build.gradle.kts index adb2b57aad..0d8afc2baf 100644 --- a/instrumentation/oracle-ucp-11.2/javaagent/build.gradle.kts +++ b/instrumentation/oracle-ucp-11.2/javaagent/build.gradle.kts @@ -22,29 +22,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { test { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", collectMetadata) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/oracle-ucp-11.2/library/build.gradle.kts b/instrumentation/oracle-ucp-11.2/library/build.gradle.kts index c8faa16543..cadfa239b2 100644 --- a/instrumentation/oracle-ucp-11.2/library/build.gradle.kts +++ b/instrumentation/oracle-ucp-11.2/library/build.gradle.kts @@ -10,26 +10,18 @@ dependencies { testImplementation(project(":instrumentation:oracle-ucp-11.2:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { test { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/oshi/javaagent/build.gradle.kts b/instrumentation/oshi/javaagent/build.gradle.kts index 564e16df46..6b517888ea 100644 --- a/instrumentation/oshi/javaagent/build.gradle.kts +++ b/instrumentation/oshi/javaagent/build.gradle.kts @@ -22,28 +22,20 @@ dependencies { testImplementation(project(":instrumentation:oshi:testing")) } -testing { - suites { - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.oshi.experimental-metrics.enabled=true") - systemProperty("testExperimental", "true") - systemProperty("metadataConfig", "otel.instrumentation.oshi.experimental-metrics.enabled=true") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.instrumentation.oshi.experimental-metrics.enabled=true") + systemProperty("testExperimental", "true") + systemProperty("metadataConfig", "otel.instrumentation.oshi.experimental-metrics.enabled=true") + } + check { - dependsOn(testing.suites) + dependsOn(testExperimental) } } diff --git a/instrumentation/pulsar/pulsar-2.8/javaagent/build.gradle.kts b/instrumentation/pulsar/pulsar-2.8/javaagent/build.gradle.kts index eda023403e..688006a622 100644 --- a/instrumentation/pulsar/pulsar-2.8/javaagent/build.gradle.kts +++ b/instrumentation/pulsar/pulsar-2.8/javaagent/build.gradle.kts @@ -19,24 +19,16 @@ dependencies { testImplementation("org.apache.pulsar:pulsar-client-admin:2.8.0") } -testing { - suites { - val testReceiveSpanDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("PulsarClientSuppressReceiveSpansTest") - } - include("**/PulsarClientSuppressReceiveSpansTest.*") - } - } - } - } - } -} - tasks { + val testReceiveSpanDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("PulsarClientSuppressReceiveSpansTest") + } + include("**/PulsarClientSuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("PulsarClientSuppressReceiveSpansTest") @@ -45,7 +37,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testReceiveSpanDisabled) } } diff --git a/instrumentation/r2dbc-1.0/javaagent/build.gradle.kts b/instrumentation/r2dbc-1.0/javaagent/build.gradle.kts index 6ad541ed8e..2e587611db 100644 --- a/instrumentation/r2dbc-1.0/javaagent/build.gradle.kts +++ b/instrumentation/r2dbc-1.0/javaagent/build.gradle.kts @@ -30,26 +30,18 @@ dependencies { testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/r2dbc-1.0/library/build.gradle.kts b/instrumentation/r2dbc-1.0/library/build.gradle.kts index af66fb5dbe..76592a4ec2 100644 --- a/instrumentation/r2dbc-1.0/library/build.gradle.kts +++ b/instrumentation/r2dbc-1.0/library/build.gradle.kts @@ -10,26 +10,18 @@ dependencies { testImplementation(project(":instrumentation:reactor:reactor-3.1:library")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/reactor/reactor-3.1/javaagent/build.gradle.kts b/instrumentation/reactor/reactor-3.1/javaagent/build.gradle.kts index 6c7a03cb85..e53ec2d920 100644 --- a/instrumentation/reactor/reactor-3.1/javaagent/build.gradle.kts +++ b/instrumentation/reactor/reactor-3.1/javaagent/build.gradle.kts @@ -53,32 +53,24 @@ testing { implementation("io.projectreactor:reactor-test:$version") } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code") - } - } - } - } - - val testBothSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") - } - } - } - } } } tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code") + } + + val testBothSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=code/dup") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv, testBothSemconv) } } diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-0.9/javaagent/build.gradle.kts b/instrumentation/reactor/reactor-netty/reactor-netty-0.9/javaagent/build.gradle.kts index 87e3337cdb..56e96b72fb 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-0.9/javaagent/build.gradle.kts +++ b/instrumentation/reactor/reactor-netty/reactor-netty-0.9/javaagent/build.gradle.kts @@ -31,26 +31,18 @@ dependencies { latestDepTestLibrary("io.projectreactor.netty:reactor-netty:0.+") // see reactor-netty-1.0 modules } -testing { - suites { - val testConnectionSpan by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("ReactorNettyConnectionSpanTest") - } - include("**/ReactorNettyConnectionSpanTest.*") - jvmArgs("-Dotel.instrumentation.netty.connection-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") - } - } - } - } - } -} - tasks { + val testConnectionSpan by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("ReactorNettyConnectionSpanTest") + } + include("**/ReactorNettyConnectionSpanTest.*") + jvmArgs("-Dotel.instrumentation.netty.connection-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") + } + test { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") @@ -60,6 +52,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testConnectionSpan) } } diff --git a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/build.gradle.kts b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/build.gradle.kts index 9458b6d2e1..78829717fe 100644 --- a/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/build.gradle.kts +++ b/instrumentation/reactor/reactor-netty/reactor-netty-1.0/javaagent/build.gradle.kts @@ -43,28 +43,20 @@ dependencies { testImplementation(project(":instrumentation-annotations")) } -testing { - suites { - val testConnectionSpan by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("ReactorNettyConnectionSpanTest") - includeTestsMatching("ReactorNettyClientSslTest") - } - include("**/ReactorNettyConnectionSpanTest.*", "**/ReactorNettyClientSslTest.*") - jvmArgs("-Dotel.instrumentation.netty.ssl-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.reactor-netty.connection-telemetry.enabled=true") - jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") - } - } - } - } - } -} - tasks { + val testConnectionSpan by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("ReactorNettyConnectionSpanTest") + includeTestsMatching("ReactorNettyClientSslTest") + } + include("**/ReactorNettyConnectionSpanTest.*", "**/ReactorNettyClientSslTest.*") + jvmArgs("-Dotel.instrumentation.netty.ssl-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.reactor-netty.connection-telemetry.enabled=true") + jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") + } + test { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") @@ -75,6 +67,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testConnectionSpan) } } diff --git a/instrumentation/redisson/redisson-3.17/javaagent/build.gradle.kts b/instrumentation/redisson/redisson-3.17/javaagent/build.gradle.kts index d553e1cbc1..d9e4b881b6 100644 --- a/instrumentation/redisson/redisson-3.17/javaagent/build.gradle.kts +++ b/instrumentation/redisson/redisson-3.17/javaagent/build.gradle.kts @@ -24,27 +24,19 @@ dependencies { testImplementation(project(":instrumentation:redisson:redisson-common:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/build.gradle.kts b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/build.gradle.kts index d0203cd663..9948b881a7 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/build.gradle.kts +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-5.0/javaagent/build.gradle.kts @@ -17,24 +17,16 @@ dependencies { testImplementation(project(":instrumentation:rocketmq:rocketmq-client:rocketmq-client-5.0:testing")) } -testing { - suites { - val testReceiveSpanDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("RocketMqClientSuppressReceiveSpanTest") - } - include("**/RocketMqClientSuppressReceiveSpanTest.*") - } - } - } - } - } -} - tasks { + val testReceiveSpanDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("RocketMqClientSuppressReceiveSpanTest") + } + include("**/RocketMqClientSuppressReceiveSpanTest.*") + } + test { filter { excludeTestsMatching("RocketMqClientSuppressReceiveSpanTest") @@ -44,6 +36,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testReceiveSpanDisabled) } } diff --git a/instrumentation/runtime-telemetry/runtime-telemetry-java17/library/build.gradle.kts b/instrumentation/runtime-telemetry/runtime-telemetry-java17/library/build.gradle.kts index 55e550600d..a261bb7e75 100644 --- a/instrumentation/runtime-telemetry/runtime-telemetry-java17/library/build.gradle.kts +++ b/instrumentation/runtime-telemetry/runtime-telemetry-java17/library/build.gradle.kts @@ -11,52 +11,6 @@ dependencies { testImplementation("io.github.netmikey.logunit:logunit-jul:1.1.3") } -testing { - suites { - val testG1 by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*G1GcMemoryMetricTest*") - } - include("**/*G1GcMemoryMetricTest.*") - jvmArgs("-XX:+UseG1GC") - } - } - } - } - - val testPS by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*PsGcMemoryMetricTest*") - } - include("**/*PsGcMemoryMetricTest.*") - jvmArgs("-XX:+UseParallelGC") - } - } - } - } - - val testSerial by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*SerialGcMemoryMetricTest*") - } - include("**/*SerialGcMemoryMetricTest.*") - jvmArgs("-XX:+UseSerialGC") - } - } - } - } - } -} - tasks.register("generateDocs", JavaExec::class) { group = "build" description = "Generate table for README.md" @@ -66,6 +20,36 @@ tasks.register("generateDocs", JavaExec::class) { } tasks { + val testG1 by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*G1GcMemoryMetricTest*") + } + include("**/*G1GcMemoryMetricTest.*") + jvmArgs("-XX:+UseG1GC") + } + + val testPS by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*PsGcMemoryMetricTest*") + } + include("**/*PsGcMemoryMetricTest.*") + jvmArgs("-XX:+UseParallelGC") + } + + val testSerial by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*SerialGcMemoryMetricTest*") + } + include("**/*SerialGcMemoryMetricTest.*") + jvmArgs("-XX:+UseSerialGC") + } + test { filter { excludeTestsMatching("*G1GcMemoryMetricTest") @@ -75,7 +59,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testG1, testPS, testSerial) } compileJava { diff --git a/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts index e3cd3a6987..7841db5667 100644 --- a/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-batch-3.0/javaagent/build.gradle.kts @@ -24,40 +24,28 @@ dependencies { latestDepTestLibrary("org.springframework.batch:spring-batch-core:4.+") // documented limitation } -testing { - suites { - val testChunkRootSpan by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*ChunkRootSpanTest") - } - include("**/*ChunkRootSpanTest.*") - jvmArgs("-Dotel.instrumentation.spring-batch.experimental.chunk.new-trace=true") - } - } - } - } - - val testItemLevelSpan by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("*ItemLevelSpanTest") - includeTestsMatching("*CustomSpanEventTest") - } - include("**/*ItemLevelSpanTest.*", "**/*CustomSpanEventTest.*") - jvmArgs("-Dotel.instrumentation.spring-batch.item.enabled=true") - } - } - } - } - } -} - tasks { + val testChunkRootSpan by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*ChunkRootSpanTest") + } + include("**/*ChunkRootSpanTest.*") + jvmArgs("-Dotel.instrumentation.spring-batch.experimental.chunk.new-trace=true") + } + + val testItemLevelSpan by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("*ItemLevelSpanTest") + includeTestsMatching("*CustomSpanEventTest") + } + include("**/*ItemLevelSpanTest.*", "**/*CustomSpanEventTest.*") + jvmArgs("-Dotel.instrumentation.spring-batch.item.enabled=true") + } + test { filter { excludeTestsMatching("*ChunkRootSpanTest") @@ -70,7 +58,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testChunkRootSpan, testItemLevelSpan) } withType().configureEach { diff --git a/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts b/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts index 499d3e59de..513b8d8948 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts +++ b/instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts @@ -174,16 +174,6 @@ testing { } } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -230,7 +220,13 @@ tasks { from(sourceSets["javaSpring3"].java) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts b/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts index 7a55cf62dc..6f342906ac 100644 --- a/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-data/spring-data-1.8/javaagent/build.gradle.kts @@ -45,21 +45,6 @@ dependencies { latestDepTestLibrary("org.springframework:spring-test:5.+") // see spring-data-3.0:testing module } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { jvmArgs("--add-opens=java.base/java.lang.invoke=ALL-UNNAMED") @@ -70,7 +55,14 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts b/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts index 59f657658f..3460a828ab 100644 --- a/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts +++ b/instrumentation/spring/spring-data/spring-data-3.0/testing/build.gradle.kts @@ -36,16 +36,6 @@ testing { implementation("com.h2database:h2:1.4.197") } } - - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } } } @@ -57,7 +47,13 @@ tasks { jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true") } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testing.suites, testStableSemconv) } } diff --git a/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts index 547a30cd92..ad76d268a5 100644 --- a/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-integration-4.1/javaagent/build.gradle.kts @@ -40,44 +40,32 @@ dependencies { latestDepTestLibrary("org.springframework.cloud:spring-cloud-stream-binder-rabbit:3.+") // documented limitation } -testing { - suites { - val testWithRabbitInstrumentation by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("SpringIntegrationAndRabbitTest") - } - include("**/SpringIntegrationAndRabbitTest.*") - jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true") - jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true") - systemProperty("metadataConfig", "otel.instrumentation.spring-rabbit.enabled=true") - } - } - } - } - - val testWithProducerInstrumentation by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("SpringCloudStreamProducerTest") - } - include("**/SpringCloudStreamProducerTest.*") - jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false") - jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false") - jvmArgs("-Dotel.instrumentation.spring-integration.producer.enabled=true") - systemProperty("metadataConfig", "otel.instrumentation.spring-integration.producer.enabled=true") - } - } - } - } - } -} - tasks { + val testWithRabbitInstrumentation by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("SpringIntegrationAndRabbitTest") + } + include("**/SpringIntegrationAndRabbitTest.*") + jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=true") + jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=true") + systemProperty("metadataConfig", "otel.instrumentation.spring-rabbit.enabled=true") + } + + val testWithProducerInstrumentation by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("SpringCloudStreamProducerTest") + } + include("**/SpringCloudStreamProducerTest.*") + jvmArgs("-Dotel.instrumentation.rabbitmq.enabled=false") + jvmArgs("-Dotel.instrumentation.spring-rabbit.enabled=false") + jvmArgs("-Dotel.instrumentation.spring-integration.producer.enabled=true") + systemProperty("metadataConfig", "otel.instrumentation.spring-integration.producer.enabled=true") + } + test { filter { excludeTestsMatching("SpringIntegrationAndRabbitTest") @@ -88,7 +76,7 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testWithRabbitInstrumentation, testWithProducerInstrumentation) } withType().configureEach { diff --git a/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts index 28e72db753..3ef0f27fc8 100644 --- a/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-jms/spring-jms-6.0/javaagent/build.gradle.kts @@ -34,29 +34,21 @@ otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } -testing { - suites { - val testReceiveSpansDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("SpringListenerSuppressReceiveSpansTest") - } - include("**/SpringListenerSuppressReceiveSpansTest.*") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + val testReceiveSpansDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("SpringListenerSuppressReceiveSpansTest") + } + include("**/SpringListenerSuppressReceiveSpansTest.*") + } + test { filter { excludeTestsMatching("SpringListenerSuppressReceiveSpansTest") @@ -65,6 +57,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testReceiveSpansDisabled) } } diff --git a/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts index f96eecb914..f8d0034631 100644 --- a/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-scheduling-3.1/javaagent/build.gradle.kts @@ -20,21 +20,6 @@ dependencies { testLibrary("org.springframework:spring-context:3.2.3.RELEASE") } -testing { - suites { - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.instrumentation.spring-scheduling.experimental-span-attributes=true") - systemProperty("metadataConfig", "otel.instrumentation.spring-scheduling.experimental-span-attributes=true") - } - } - } - } - } -} - tasks { withType().configureEach { // required on jdk17 @@ -43,6 +28,17 @@ tasks { systemProperty("collectMetadata", findProperty("collectMetadata")?.toString() ?: "false") } + + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.instrumentation.spring-scheduling.experimental-span-attributes=true") + systemProperty("metadataConfig", "otel.instrumentation.spring-scheduling.experimental-span-attributes=true") + } + + check { + dependsOn(testExperimental) + } } val latestDepTest = findProperty("testLatestDeps") as Boolean diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts b/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts index 706a38466a..fbcefb4bd6 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/javaagent/build.gradle.kts @@ -43,21 +43,6 @@ dependencies { latestDepTestLibrary("org.springframework.boot:spring-boot-starter-security:2.+") // see spring-webmvc-6.0 module } -testing { - suites { - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - systemProperty("metadataConfig", "otel.instrumentation.spring-webmvc.experimental-span-attributes=true") - jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") - } - } - } - } - } -} - tasks { withType().configureEach { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) @@ -71,8 +56,15 @@ tasks { jvmArgs("-Dotel.instrumentation.common.experimental.view-telemetry.enabled=true") } + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + systemProperty("metadataConfig", "otel.instrumentation.spring-webmvc.experimental-span-attributes=true") + jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") + } + check { - dependsOn(testing.suites) + dependsOn(testExperimental) } } diff --git a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts index 26975f21b7..cf6d5fb378 100644 --- a/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/javaagent/build.gradle.kts @@ -44,21 +44,6 @@ otelJava { minJavaVersionSupported.set(JavaVersion.VERSION_17) } -testing { - suites { - val testExperimental by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - systemProperty("metadataConfig", "otel.instrumentation.spring-webmvc.experimental-span-attributes=true") - jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") - } - } - } - } - } -} - tasks { withType().configureEach { // required on jdk17 @@ -71,7 +56,14 @@ tasks { systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean) } + val testExperimental by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + systemProperty("metadataConfig", "otel.instrumentation.spring-webmvc.experimental-span-attributes=true") + jvmArgs("-Dotel.instrumentation.spring-webmvc.experimental-span-attributes=true") + } + check { - dependsOn(testing.suites) + dependsOn(testExperimental) } } diff --git a/instrumentation/spymemcached-2.12/javaagent/build.gradle.kts b/instrumentation/spymemcached-2.12/javaagent/build.gradle.kts index a9b6ac8947..5ee157c6cc 100644 --- a/instrumentation/spymemcached-2.12/javaagent/build.gradle.kts +++ b/instrumentation/spymemcached-2.12/javaagent/build.gradle.kts @@ -20,20 +20,6 @@ dependencies { testImplementation("com.google.guava:guava") } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { // TODO run tests both with and without experimental span attributes @@ -41,7 +27,13 @@ tasks { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/tomcat/tomcat-jdbc/javaagent/build.gradle.kts b/instrumentation/tomcat/tomcat-jdbc/javaagent/build.gradle.kts index 1a70024f77..7351efd94b 100644 --- a/instrumentation/tomcat/tomcat-jdbc/javaagent/build.gradle.kts +++ b/instrumentation/tomcat/tomcat-jdbc/javaagent/build.gradle.kts @@ -18,28 +18,20 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/vertx/vertx-redis-client-4.0/javaagent/build.gradle.kts b/instrumentation/vertx/vertx-redis-client-4.0/javaagent/build.gradle.kts index 96fe679baf..db170f3704 100644 --- a/instrumentation/vertx/vertx-redis-client-4.0/javaagent/build.gradle.kts +++ b/instrumentation/vertx/vertx-redis-client-4.0/javaagent/build.gradle.kts @@ -22,29 +22,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", collectMetadata) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/vertx/vertx-sql-client/vertx-sql-client-4.0/javaagent/build.gradle.kts b/instrumentation/vertx/vertx-sql-client/vertx-sql-client-4.0/javaagent/build.gradle.kts index 3d416d5eba..43a920dc03 100644 --- a/instrumentation/vertx/vertx-sql-client/vertx-sql-client-4.0/javaagent/build.gradle.kts +++ b/instrumentation/vertx/vertx-sql-client/vertx-sql-client-4.0/javaagent/build.gradle.kts @@ -30,29 +30,21 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", collectMetadata) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/vertx/vertx-sql-client/vertx-sql-client-5.0/javaagent/build.gradle.kts b/instrumentation/vertx/vertx-sql-client/vertx-sql-client-5.0/javaagent/build.gradle.kts index 281d539cc2..20707eb614 100644 --- a/instrumentation/vertx/vertx-sql-client/vertx-sql-client-5.0/javaagent/build.gradle.kts +++ b/instrumentation/vertx/vertx-sql-client/vertx-sql-client-5.0/javaagent/build.gradle.kts @@ -30,28 +30,20 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { withType().configureEach { usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) systemProperty("collectMetadata", collectMetadata) } + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/vibur-dbcp-11.0/javaagent/build.gradle.kts b/instrumentation/vibur-dbcp-11.0/javaagent/build.gradle.kts index fb3f35cab2..838f41b828 100644 --- a/instrumentation/vibur-dbcp-11.0/javaagent/build.gradle.kts +++ b/instrumentation/vibur-dbcp-11.0/javaagent/build.gradle.kts @@ -21,28 +21,20 @@ dependencies { val collectMetadata = findProperty("collectMetadata")?.toString() ?: "false" -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - systemProperty("collectMetadata", collectMetadata) - systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + systemProperty("collectMetadata", collectMetadata) + systemProperty("metadataConfig", "otel.semconv-stability.opt-in=database") + } + test { systemProperty("collectMetadata", collectMetadata) } check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/instrumentation/vibur-dbcp-11.0/library/build.gradle.kts b/instrumentation/vibur-dbcp-11.0/library/build.gradle.kts index 56ad0a1432..41cd2789b1 100644 --- a/instrumentation/vibur-dbcp-11.0/library/build.gradle.kts +++ b/instrumentation/vibur-dbcp-11.0/library/build.gradle.kts @@ -9,22 +9,14 @@ dependencies { testImplementation(project(":instrumentation:vibur-dbcp-11.0:testing")) } -testing { - suites { - val testStableSemconv by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - jvmArgs("-Dotel.semconv-stability.opt-in=database") - } - } - } - } - } -} - tasks { + val testStableSemconv by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + jvmArgs("-Dotel.semconv-stability.opt-in=database") + } + check { - dependsOn(testing.suites) + dependsOn(testStableSemconv) } } diff --git a/testing-common/integration-tests/build.gradle.kts b/testing-common/integration-tests/build.gradle.kts index ba4772d422..01a39a95ae 100644 --- a/testing-common/integration-tests/build.gradle.kts +++ b/testing-common/integration-tests/build.gradle.kts @@ -27,44 +27,32 @@ dependencies { testImplementation("net.sf.jt400:jt400:6.1") } -testing { - suites { - val testFieldInjectionDisabled by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("context.FieldInjectionDisabledTest") - } - include("**/FieldInjectionDisabledTest.*") - jvmArgs("-Dotel.javaagent.experimental.field-injection.enabled=false") - } - } - } - } - - val testFieldBackedImplementation by registering(JvmTestSuite::class) { - targets { - all { - testTask.configure { - filter { - includeTestsMatching("context.FieldBackedImplementationTest") - } - include("**/FieldBackedImplementationTest.*") - // this test uses reflection to access fields generated by FieldBackedProvider - // internal-reflection needs to be disabled because it removes these fields from reflection results. - jvmArgs("-Dotel.instrumentation.internal-reflection.enabled=false") - // required on jdk17 - jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") - jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") - } - } - } - } - } -} - tasks { + val testFieldInjectionDisabled by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("context.FieldInjectionDisabledTest") + } + include("**/FieldInjectionDisabledTest.*") + jvmArgs("-Dotel.javaagent.experimental.field-injection.enabled=false") + } + + val testFieldBackedImplementation by registering(Test::class) { + testClassesDirs = sourceSets.test.get().output.classesDirs + classpath = sourceSets.test.get().runtimeClasspath + filter { + includeTestsMatching("context.FieldBackedImplementationTest") + } + include("**/FieldBackedImplementationTest.*") + // this test uses reflection to access fields generated by FieldBackedProvider + // internal-reflection needs to be disabled because it removes these fields from reflection results. + jvmArgs("-Dotel.instrumentation.internal-reflection.enabled=false") + // required on jdk17 + jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") + jvmArgs("-XX:+IgnoreUnrecognizedVMOptions") + } + test { filter { excludeTestsMatching("context.FieldInjectionDisabledTest") @@ -75,6 +63,6 @@ tasks { } check { - dependsOn(testing.suites) + dependsOn(testFieldInjectionDisabled, testFieldBackedImplementation) } }