build.gradle.kts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. plugins {
  2. id("otel.javaagent-testing")
  3. }
  4. dependencies {
  5. testInstrumentation(project(":instrumentation:spring:spring-cloud-gateway:spring-cloud-gateway-2.0:javaagent"))
  6. testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent"))
  7. testInstrumentation(project(":instrumentation:reactor:reactor-3.1:javaagent"))
  8. testInstrumentation(project(":instrumentation:reactor:reactor-netty:reactor-netty-1.0:javaagent"))
  9. testInstrumentation(project(":instrumentation:spring:spring-webflux:spring-webflux-5.0:javaagent"))
  10. testImplementation(project(":instrumentation:spring:spring-cloud-gateway:spring-cloud-gateway-common:testing"))
  11. testLibrary("org.springframework.cloud:spring-cloud-starter-gateway:2.2.0.RELEASE")
  12. testLibrary("org.springframework.boot:spring-boot-starter-test:2.2.0.RELEASE")
  13. }
  14. tasks.withType<Test>().configureEach {
  15. jvmArgs("-Dotel.instrumentation.spring-cloud-gateway.experimental-span-attributes=true")
  16. // required on jdk17
  17. jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
  18. jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
  19. jvmArgs("-Dotel.instrumentation.common.experimental.controller-telemetry.enabled=true")
  20. systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
  21. }
  22. val latestDepTest = findProperty("testLatestDeps") as Boolean
  23. if (latestDepTest) {
  24. // spring 6 requires java 17
  25. otelJava {
  26. minJavaVersionSupported.set(JavaVersion.VERSION_17)
  27. }
  28. } else {
  29. // spring 5 requires old logback (and therefore also old slf4j)
  30. configurations.testRuntimeClasspath {
  31. resolutionStrategy {
  32. force("ch.qos.logback:logback-classic:1.2.11")
  33. force("org.slf4j:slf4j-api:1.7.36")
  34. }
  35. }
  36. }