build.gradle.kts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. plugins {
  2. id("otel.javaagent-instrumentation")
  3. id("otel.scala-conventions")
  4. }
  5. muzzle {
  6. pass {
  7. coreJdk()
  8. }
  9. }
  10. dependencies {
  11. bootstrap(project(":instrumentation:executors:bootstrap"))
  12. testImplementation(project(":instrumentation:executors:testing"))
  13. testImplementation("org.scala-lang:scala-library:2.11.12")
  14. testCompileOnly(project(":instrumentation:executors:bootstrap"))
  15. }
  16. testing {
  17. suites {
  18. // CompletableFuture behaves differently if ForkJoinPool has no parallelism
  19. val testNoParallelism by registering(JvmTestSuite::class) {
  20. sources {
  21. java {
  22. setSrcDirs(listOf("src/test/java"))
  23. }
  24. }
  25. dependencies {
  26. implementation(project(":instrumentation:executors:testing"))
  27. compileOnly(project(":instrumentation:executors:bootstrap"))
  28. }
  29. targets {
  30. all {
  31. testTask.configure {
  32. systemProperty("java.util.concurrent.ForkJoinPool.common.parallelism", 1)
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. tasks {
  40. withType<Test>().configureEach {
  41. // needed for VirtualThreadTest on jdk21
  42. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  43. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  44. jvmArgs(
  45. "-Dotel.instrumentation.executors.include=io.opentelemetry.javaagent.instrumentation.executors.ExecutorInstrumentationTest\$CustomThreadPoolExecutor,io.opentelemetry.javaagent.instrumentation.executors.ThreadPoolExecutorTest\$RunnableCheckingThreadPoolExecutor"
  46. )
  47. jvmArgs("-Djava.awt.headless=true")
  48. jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
  49. }
  50. check {
  51. dependsOn(testing.suites)
  52. }
  53. }