build.gradle.kts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. id("org.unbroken-dome.test-sets")
  4. }
  5. muzzle {
  6. pass {
  7. group.set("javax.jms")
  8. module.set("jms-api")
  9. versions.set("(,)")
  10. }
  11. pass {
  12. group.set("javax.jms")
  13. module.set("javax.jms-api")
  14. versions.set("(,)")
  15. }
  16. }
  17. testSets {
  18. create("jms2Test")
  19. create("jms2TestReceiveSpansDisabled") {
  20. extendsFrom("jms2Test")
  21. }
  22. }
  23. tasks {
  24. val testReceiveSpansDisabled by registering(Test::class) {
  25. filter {
  26. includeTestsMatching("SpringListenerJms1SuppressReceiveSpansTest")
  27. isFailOnNoMatchingTests = false
  28. }
  29. include("**/SpringListenerJms1SuppressReceiveSpansTest.*")
  30. jvmArgs("-Dotel.instrumentation.common.experimental.suppress-messaging-receive-spans=true")
  31. }
  32. val jms2Test by existing(Test::class) {
  33. filter {
  34. // this is needed because "test.dependsOn jms2Test", and so without this,
  35. // running a single test in the default test set will fail
  36. isFailOnNoMatchingTests = false
  37. }
  38. }
  39. val jms2TestReceiveSpansDisabled by existing(Test::class) {
  40. filter {
  41. isFailOnNoMatchingTests = false
  42. }
  43. jvmArgs("-Dotel.instrumentation.common.experimental.suppress-messaging-receive-spans=true")
  44. }
  45. test {
  46. dependsOn(testReceiveSpansDisabled)
  47. dependsOn(jms2Test)
  48. dependsOn(jms2TestReceiveSpansDisabled)
  49. usesService(gradle.sharedServices.registrations["testcontainersBuildService"].getService())
  50. filter {
  51. excludeTestsMatching("SpringListenerJms1SuppressReceiveSpansTest")
  52. isFailOnNoMatchingTests = false
  53. }
  54. }
  55. }
  56. val versions: Map<String, String> by project
  57. dependencies {
  58. compileOnly("com.google.auto.value:auto-value-annotations")
  59. annotationProcessor("com.google.auto.value:auto-value")
  60. compileOnly("javax.jms:jms-api:1.1-rev-1")
  61. testImplementation("javax.annotation:javax.annotation-api:1.3.2")
  62. testImplementation("org.springframework.boot:spring-boot-starter-activemq:${versions["org.springframework.boot"]}")
  63. testImplementation("org.springframework.boot:spring-boot-starter-test:${versions["org.springframework.boot"]}") {
  64. exclude("org.junit.vintage", "junit-vintage-engine")
  65. }
  66. add("jms2TestImplementation", "org.hornetq:hornetq-jms-client:2.4.7.Final")
  67. add("jms2TestImplementation", "org.hornetq:hornetq-jms-server:2.4.7.Final") {
  68. // this doesn't exist in maven central, and doesn't seem to be needed anyways
  69. exclude("org.jboss.naming", "jnpserver")
  70. }
  71. // this is just to avoid a bit more copy-pasting
  72. add("jms2TestReceiveSpansDisabledImplementation", sourceSets["jms2Test"].output)
  73. }