diff --git a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts index 2fd6753649d0..17c275f9db3f 100644 --- a/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts +++ b/instrumentation/spring/spring-jms/spring-jms-2.0/javaagent/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id("otel.javaagent-instrumentation") - id("org.unbroken-dome.test-sets") } muzzle { @@ -14,23 +13,6 @@ muzzle { } } -testSets { - create("testReceiveSpansDisabled") -} - -tasks { - test { - usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) - jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true") - } - - val testReceiveSpansDisabled by existing - - check { - dependsOn(testReceiveSpansDisabled) - } -} - dependencies { implementation(project(":instrumentation:jms:jms-common:javaagent")) implementation(project(":instrumentation:jms:jms-1.1:javaagent")) @@ -54,7 +36,35 @@ dependencies { } latestDepTestLibrary("org.springframework:spring-jms:5.+") +} - // this is just to avoid a bit more copy-pasting - add("testReceiveSpansDisabledImplementation", sourceSets["test"].output) +testing { + suites { + val testReceiveSpansDisabled by registering(JvmTestSuite::class) { + dependencies { + // this is just to avoid a bit more copy-pasting + implementation(project.sourceSets["test"].output) + } + } + } +} + +configurations { + named("testReceiveSpansDisabledImplementation") { + extendsFrom(configurations["testImplementation"]) + } +} + +tasks { + withType().configureEach { + usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service) + } + // this does not apply to testReceiveSpansDisabled + test { + jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true") + } + + check { + dependsOn(testing.suites) + } }