Skip to content

Commit

Permalink
Convert vaadin tests to test suites (#7944)
Browse files Browse the repository at this point in the history
Part of
#7911
  • Loading branch information
laurit authored Mar 1, 2023
1 parent 5fa02fd commit 8c1b072
Showing 1 changed file with 49 additions and 48 deletions.
97 changes: 49 additions & 48 deletions instrumentation/vaadin-14.2/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("otel.javaagent-instrumentation")
id("org.unbroken-dome.test-sets")
}

muzzle {
Expand All @@ -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 {
compileOnly("com.google.auto.value:auto-value-annotations")
annotationProcessor("com.google.auto.value:auto-value")
Expand All @@ -58,34 +33,60 @@ dependencies {

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-javax-common: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 {
listOf(
testRuntimeClasspath,
named("vaadin142TestRuntimeClasspath"),
named("vaadin14LatestTestRuntimeClasspath"),
named("vaadin16TestRuntimeClasspath"),
named("latestDepTestRuntimeClasspath"),
)
.forEach {
it.configure {
resolutionStrategy {
// requires old logback (and therefore also old slf4j)
force("ch.qos.logback:logback-classic:1.2.11")
force("org.slf4j:slf4j-api:1.7.36")
}
testing {
suites {
val vaadin142Test by registering(JvmTestSuite::class) {
dependencies {
implementation(project(":instrumentation:vaadin-14.2:testing"))
implementation("com.vaadin:vaadin-spring-boot-starter:14.2.0")
}
}

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 {
// requires old logback (and therefore also old slf4j)
force("ch.qos.logback:logback-classic:1.2.11")
force("org.slf4j:slf4j-api:1.7.36")
}
}

0 comments on commit 8c1b072

Please sign in to comment.