build.gradle.kts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. }
  4. muzzle {
  5. pass {
  6. coreJdk()
  7. }
  8. }
  9. dependencies {
  10. bootstrap(project(":instrumentation:executors:bootstrap"))
  11. testImplementation(project(":instrumentation:executors:testing"))
  12. }
  13. testing {
  14. suites {
  15. // CompletableFuture behaves differently if ForkJoinPool has no parallelism
  16. val testNoParallelism by registering(JvmTestSuite::class) {
  17. sources {
  18. java {
  19. setSrcDirs(listOf("src/test/java"))
  20. }
  21. }
  22. dependencies {
  23. implementation(project(":instrumentation:executors:testing"))
  24. }
  25. targets {
  26. all {
  27. testTask.configure {
  28. systemProperty("java.util.concurrent.ForkJoinPool.common.parallelism", 1)
  29. }
  30. }
  31. }
  32. }
  33. }
  34. }
  35. tasks {
  36. withType<Test>().configureEach {
  37. jvmArgs("-Dotel.instrumentation.executors.include=io.opentelemetry.javaagent.instrumentation.javaconcurrent.ExecutorInstrumentationTest\$CustomThreadPoolExecutor")
  38. jvmArgs("-Djava.awt.headless=true")
  39. }
  40. check {
  41. dependsOn(testing.suites)
  42. }
  43. }