Skip to content

Commit

Permalink
Setup JUnit5 for jvmTest (#37)
Browse files Browse the repository at this point in the history
* Fix integrationTest
  • Loading branch information
nomisRev authored May 8, 2023
1 parent 2f352dd commit bd65f41
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@ java {
kotlin {
jvm {
compilations {
val main by getting
val integrationTest by compilations.creating {
// Create a test task to run the tests produced by this compilation:
tasks.register<Test>("integrationTest") {
description = "Run the integration tests"
group = "verification"
// Run the tests with the classpath containing the compile dependencies (including 'main'),
// runtime dependencies, and the outputs of this compilation:
classpath = compileDependencyFiles + runtimeDependencyFiles + output.allOutputs

// Run only the tests from this compilation's outputs:
testClassesDirs = output.classesDirs

testLogging {
events("passed")
}
}
}
val test by compilations.getting
integrationTest.associateWith(test)
}
}
js(IR) {
Expand Down Expand Up @@ -108,16 +105,17 @@ kotlin {
}

val commonTest by getting
val jvmTest by getting
val jvmTest by getting {
dependencies {
implementation(libs.kotest.junit5)
}
}
val linuxX64Test by getting
val macosX64Test by getting
val mingwX64Test by getting

val jvmIntegrationTest by getting {
dependsOn(jvmMain)
dependsOn(jvmTest)
dependencies {
implementation(libs.kotest.junit5)
implementation(libs.kotest.testcontainers)
implementation(libs.testcontainers.postgresql)
}
Expand Down

0 comments on commit bd65f41

Please sign in to comment.