Convert spring-jms tests to test suites (#7945)

Part of
https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/7911
This commit is contained in:
Lauri Tulmin 2023-03-01 21:24:04 +02:00 committed by GitHub
parent 0a9466523f
commit c721852d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 21 deletions

View File

@ -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<Test>().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)
}
}