build.gradle.kts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. group.set("org.apache.kafka")
  7. module.set("kafka-clients")
  8. versions.set("[0.11.0.0,)")
  9. extraDependency(project(":instrumentation:kafka-clients:kafka-clients-0.11:bootstrap"))
  10. assertInverse.set(true)
  11. }
  12. }
  13. dependencies {
  14. compileOnly("com.google.auto.value:auto-value-annotations")
  15. annotationProcessor("com.google.auto.value:auto-value")
  16. compileOnly(project(":instrumentation:kafka-clients:kafka-clients-0.11:bootstrap"))
  17. implementation(project(":instrumentation:kafka-clients:kafka-clients-common:library"))
  18. library("org.apache.kafka:kafka-clients:0.11.0.0")
  19. testImplementation("org.testcontainers:kafka")
  20. testImplementation(project(":instrumentation:kafka-clients:kafka-clients-0.11:testing"))
  21. }
  22. tasks {
  23. withType<Test>().configureEach {
  24. usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
  25. // TODO run tests both with and without experimental span attributes
  26. jvmArgs("-Dotel.instrumentation.kafka.experimental-span-attributes=true")
  27. }
  28. val testPropagationDisabled by registering(Test::class) {
  29. filter {
  30. includeTestsMatching("KafkaClientPropagationDisabledTest")
  31. isFailOnNoMatchingTests = false
  32. }
  33. include("**/KafkaClientPropagationDisabledTest.*")
  34. jvmArgs("-Dotel.instrumentation.kafka.client-propagation.enabled=false")
  35. }
  36. val testReceiveSpansDisabled by registering(Test::class) {
  37. filter {
  38. includeTestsMatching("KafkaClientSuppressReceiveSpansTest")
  39. isFailOnNoMatchingTests = false
  40. }
  41. include("**/KafkaClientSuppressReceiveSpansTest.*")
  42. jvmArgs("-Dotel.instrumentation.common.experimental.suppress-messaging-receive-spans=true")
  43. }
  44. test {
  45. dependsOn(testPropagationDisabled)
  46. dependsOn(testReceiveSpansDisabled)
  47. filter {
  48. excludeTestsMatching("KafkaClientPropagationDisabledTest")
  49. excludeTestsMatching("KafkaClientSuppressReceiveSpansTest")
  50. isFailOnNoMatchingTests = false
  51. }
  52. }
  53. }