Convert vaadin tests to test suites (#7944)

Part of
https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/7911
This commit is contained in:
Lauri Tulmin 2023-03-01 21:24:46 +02:00 committed by GitHub
parent 5fa02fd2ab
commit 8c1b072682
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 48 deletions

View File

@ -1,6 +1,5 @@
plugins { plugins {
id("otel.javaagent-instrumentation") id("otel.javaagent-instrumentation")
id("org.unbroken-dome.test-sets")
} }
muzzle { muzzle {
@ -26,30 +25,6 @@ muzzle {
} }
} }
testSets {
create("vaadin142Test")
create("vaadin14LatestTest")
create("vaadin16Test")
create("latestDepTest") {
dirName = "vaadinLatestTest"
}
}
tasks {
val vaadin142Test by existing
val vaadin16Test by existing
val vaadin14LatestTest by existing
test {
dependsOn(vaadin142Test)
dependsOn(vaadin16Test)
if (findProperty("testLatestDeps") as Boolean) {
dependsOn(vaadin14LatestTest)
}
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
}
}
dependencies { dependencies {
compileOnly("com.google.auto.value:auto-value-annotations") compileOnly("com.google.auto.value:auto-value-annotations")
annotationProcessor("com.google.auto.value:auto-value") annotationProcessor("com.google.auto.value:auto-value")
@ -58,34 +33,60 @@ dependencies {
compileOnly("com.vaadin:flow-server:2.2.0") compileOnly("com.vaadin:flow-server:2.2.0")
add("vaadin16TestImplementation", "com.vaadin:vaadin-spring-boot-starter:16.0.0")
add("vaadin142TestImplementation", "com.vaadin:vaadin-spring-boot-starter:14.2.0")
testImplementation(project(":instrumentation:vaadin-14.2:testing"))
testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent")) testInstrumentation(project(":instrumentation:servlet:servlet-3.0:javaagent"))
testInstrumentation(project(":instrumentation:servlet:servlet-javax-common:javaagent")) testInstrumentation(project(":instrumentation:servlet:servlet-javax-common:javaagent"))
testInstrumentation(project(":instrumentation:tomcat:tomcat-7.0:javaagent")) testInstrumentation(project(":instrumentation:tomcat:tomcat-7.0:javaagent"))
add("vaadin14LatestTestImplementation", "com.vaadin:vaadin-spring-boot-starter:14.+")
add("latestDepTestImplementation", "com.vaadin:vaadin-spring-boot-starter:+")
} }
configurations { testing {
listOf( suites {
testRuntimeClasspath, val vaadin142Test by registering(JvmTestSuite::class) {
named("vaadin142TestRuntimeClasspath"), dependencies {
named("vaadin14LatestTestRuntimeClasspath"), implementation(project(":instrumentation:vaadin-14.2:testing"))
named("vaadin16TestRuntimeClasspath"), implementation("com.vaadin:vaadin-spring-boot-starter:14.2.0")
named("latestDepTestRuntimeClasspath"), }
) }
.forEach {
it.configure { val vaadin16Test by registering(JvmTestSuite::class) {
dependencies {
implementation(project(":instrumentation:vaadin-14.2:testing"))
implementation("com.vaadin:vaadin-spring-boot-starter:16.0.0")
}
}
val vaadin14LatestTest by registering(JvmTestSuite::class) {
dependencies {
implementation(project(":instrumentation:vaadin-14.2:testing"))
implementation("com.vaadin:vaadin-spring-boot-starter:14.+")
}
}
val vaadinLatestTest by registering(JvmTestSuite::class) {
dependencies {
implementation(project(":instrumentation:vaadin-14.2:testing"))
implementation("com.vaadin:vaadin-spring-boot-starter:+")
}
}
}
}
tasks {
withType<Test>().configureEach {
usesService(gradle.sharedServices.registrations["testcontainersBuildService"].service)
}
check {
if (findProperty("testLatestDeps") as Boolean) {
dependsOn(testing.suites.named("vaadin14LatestTest"), testing.suites.named("vaadinLatestTest"))
} else {
dependsOn(testing.suites.named("vaadin142Test"), testing.suites.named("vaadin16Test"))
}
}
}
configurations.configureEach {
resolutionStrategy { resolutionStrategy {
// requires old logback (and therefore also old slf4j) // requires old logback (and therefore also old slf4j)
force("ch.qos.logback:logback-classic:1.2.11") force("ch.qos.logback:logback-classic:1.2.11")
force("org.slf4j:slf4j-api:1.7.36") force("org.slf4j:slf4j-api:1.7.36")
} }
}
}
} }