Skip to content

Commit

Permalink
add testSpring3 test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Jul 16, 2024
1 parent fcef9b4 commit a7786d8
Showing 1 changed file with 40 additions and 17 deletions.
57 changes: 40 additions & 17 deletions instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ configurations {
}
}

tasks {
named<JavaCompile>("compileJavaSpring3Java") {
sourceCompatibility = "17"
targetCompatibility = "17"
options.release.set(17)
}

withType(Jar::class) {
from(sourceSets["javaSpring3"].output)
}
}

dependencies {
compileOnly("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion")
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor:$springBootVersion")
Expand Down Expand Up @@ -106,15 +94,15 @@ dependencies {
testImplementation("io.opentelemetry:opentelemetry-exporter-zipkin")
testImplementation(project(":instrumentation-annotations"))

// needed for the Spring Boot 3 support
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))

// give access to common classes, e.g. InstrumentationConfigUtil
add("javaSpring3CompileOnly", files(sourceSets.main.get().output.classesDirs))
add("javaSpring3CompileOnly", "org.springframework.boot:spring-boot-starter-web:3.2.4")
add("javaSpring3CompileOnly", "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
add("javaSpring3CompileOnly", project(":instrumentation:spring:spring-web:spring-web-3.1:library"))
add("javaSpring3CompileOnly", project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))

// needed for the Spring Boot 3 support
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
}

val latestDepTest = findProperty("testLatestDeps") as Boolean
Expand Down Expand Up @@ -151,9 +139,7 @@ testing {
}
}
}
}

suites {
val testLogbackMissing by registering(JvmTestSuite::class) {
dependencies {
implementation(project())
Expand All @@ -166,6 +152,27 @@ testing {
}
}
}

val testSpring3 by registering(JvmTestSuite::class) {
dependencies {
implementation(project())
//implementation(sourceSets["javaSpring3"].output)
implementation("org.springframework.boot:spring-boot-starter-web:3.2.4")
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
implementation(project(":instrumentation:spring:spring-web:spring-web-3.1:library"))
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
implementation("jakarta.servlet:jakarta.servlet-api:5.0.0")
implementation("org.springframework.boot:spring-boot-starter-test:3.2.4") {
exclude("org.junit.vintage", "junit-vintage-engine")
}

// implementation("org.slf4j:slf4j-api") {
// version {
// strictly("1.7.32")
// }
// }
}
}
}
}

Expand All @@ -191,4 +198,20 @@ tasks {
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
}

named<JavaCompile>("compileJavaSpring3Java") {
sourceCompatibility = "17"
targetCompatibility = "17"
options.release.set(17)
}

named<JavaCompile>("compileTestSpring3Java") {
sourceCompatibility = "17"
targetCompatibility = "17"
options.release.set(17)
}

withType(Jar::class) {
from(sourceSets["javaSpring3"].output)
}
}

0 comments on commit a7786d8

Please sign in to comment.