Skip to content

Commit 506ee17

Browse files
committed
add testSpring3 test suite
1 parent fcef9b4 commit 506ee17

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

instrumentation/spring/spring-boot-autoconfigure/build.gradle.kts

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ configurations {
3131
}
3232
}
3333

34-
tasks {
35-
named<JavaCompile>("compileJavaSpring3Java") {
36-
sourceCompatibility = "17"
37-
targetCompatibility = "17"
38-
options.release.set(17)
39-
}
40-
41-
withType(Jar::class) {
42-
from(sourceSets["javaSpring3"].output)
43-
}
44-
}
45-
4634
dependencies {
4735
compileOnly("org.springframework.boot:spring-boot-autoconfigure:$springBootVersion")
4836
annotationProcessor("org.springframework.boot:spring-boot-autoconfigure-processor:$springBootVersion")
@@ -106,15 +94,15 @@ dependencies {
10694
testImplementation("io.opentelemetry:opentelemetry-exporter-zipkin")
10795
testImplementation(project(":instrumentation-annotations"))
10896

97+
// needed for the Spring Boot 3 support
98+
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
99+
109100
// give access to common classes, e.g. InstrumentationConfigUtil
110101
add("javaSpring3CompileOnly", files(sourceSets.main.get().output.classesDirs))
111102
add("javaSpring3CompileOnly", "org.springframework.boot:spring-boot-starter-web:3.2.4")
112103
add("javaSpring3CompileOnly", "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
113104
add("javaSpring3CompileOnly", project(":instrumentation:spring:spring-web:spring-web-3.1:library"))
114105
add("javaSpring3CompileOnly", project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
115-
116-
// needed for the Spring Boot 3 support
117-
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
118106
}
119107

120108
val latestDepTest = findProperty("testLatestDeps") as Boolean
@@ -151,9 +139,7 @@ testing {
151139
}
152140
}
153141
}
154-
}
155142

156-
suites {
157143
val testLogbackMissing by registering(JvmTestSuite::class) {
158144
dependencies {
159145
implementation(project())
@@ -166,6 +152,20 @@ testing {
166152
}
167153
}
168154
}
155+
156+
val testSpring3 by registering(JvmTestSuite::class) {
157+
dependencies {
158+
implementation(project())
159+
implementation("org.springframework.boot:spring-boot-starter-web:3.2.4")
160+
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
161+
implementation(project(":instrumentation:spring:spring-web:spring-web-3.1:library"))
162+
implementation(project(":instrumentation:spring:spring-webmvc:spring-webmvc-6.0:library"))
163+
implementation("jakarta.servlet:jakarta.servlet-api:5.0.0")
164+
implementation("org.springframework.boot:spring-boot-starter-test:3.2.4") {
165+
exclude("org.junit.vintage", "junit-vintage-engine")
166+
}
167+
}
168+
}
169169
}
170170
}
171171

@@ -191,4 +191,20 @@ tasks {
191191
jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
192192
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
193193
}
194+
195+
named<JavaCompile>("compileJavaSpring3Java") {
196+
sourceCompatibility = "17"
197+
targetCompatibility = "17"
198+
options.release.set(17)
199+
}
200+
201+
named<JavaCompile>("compileTestSpring3Java") {
202+
sourceCompatibility = "17"
203+
targetCompatibility = "17"
204+
options.release.set(17)
205+
}
206+
207+
withType(Jar::class) {
208+
from(sourceSets["javaSpring3"].output)
209+
}
194210
}

0 commit comments

Comments
 (0)