From 6358c257348789536b211c5c622ddeb9f7fcc5f9 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Wed, 1 Mar 2023 11:13:14 +0200 Subject: [PATCH] Convert spring-jms tests to test suites --- .../spring-jms-2.0/javaagent/build.gradle.kts | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) 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) + } }