Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert vaadin tests to test suites #7944

Merged
merged 1 commit into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}