build.gradle.kts 1.9 KB

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