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 hibernate tests to test suites #7929

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
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 @@ -12,24 +11,6 @@ muzzle {
}
}

testSets {
create("version5Test") {
dirName = "test"
}

create("latestDepTest") {
dirName = "test"
}
}

tasks {
val version5Test by existing(Test::class)

test {
dependsOn(version5Test)
}
}

dependencies {
compileOnly("org.hibernate:hibernate-core:4.0.0.Final")

Expand All @@ -51,14 +32,44 @@ dependencies {

testImplementation("org.hibernate:hibernate-core:4.0.0.Final")
testImplementation("org.hibernate:hibernate-entitymanager:4.0.0.Final")
}

add("version5TestImplementation", "org.hibernate:hibernate-core:5.0.0.Final")
add("version5TestImplementation", "org.hibernate:hibernate-entitymanager:5.0.0.Final")
add("version5TestImplementation", "org.springframework.data:spring-data-jpa:2.3.0.RELEASE")
val latestDepTest = findProperty("testLatestDeps") as Boolean
testing {
suites {
val version5Test by registering(JvmTestSuite::class) {
dependencies {
sources {
groovy {
setSrcDirs(listOf("src/test/groovy"))
}
java {
setSrcDirs(listOf("src/test/java"))
}
resources {
setSrcDirs(listOf("src/test/resources"))
}
}

add("latestDepTestImplementation", "org.hibernate:hibernate-core:5.+")
add("latestDepTestImplementation", "org.hibernate:hibernate-entitymanager:5.+")
add("latestDepTestImplementation", "org.springframework.data:spring-data-jpa:(2.4.0,3)")
implementation("com.h2database:h2:1.4.197")
implementation("javax.xml.bind:jaxb-api:2.2.11")
implementation("com.sun.xml.bind:jaxb-core:2.2.11")
implementation("com.sun.xml.bind:jaxb-impl:2.2.11")
implementation("javax.activation:activation:1.1.1")
implementation("org.hsqldb:hsqldb:2.0.0")

if (latestDepTest) {
implementation("org.hibernate:hibernate-core:5.0.0.Final")
implementation("org.hibernate:hibernate-entitymanager:5.0.0.Final")
implementation("org.springframework.data:spring-data-jpa:2.3.0.RELEASE")
} else {
implementation("org.hibernate:hibernate-core:5.+")
implementation("org.hibernate:hibernate-entitymanager:5.+")
implementation("org.springframework.data:spring-data-jpa:(2.4.0,3)")
}
}
}
}
}

tasks.withType<Test>().configureEach {
Expand All @@ -70,3 +81,9 @@ tasks.withType<Test>().configureEach {
// TODO run tests both with and without experimental span attributes
jvmArgs("-Dotel.instrumentation.hibernate.experimental-span-attributes=true")
}

tasks {
check {
dependsOn(testing.suites)
}
}