1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-04-20 01:36:50 +00:00

Move integration tests into own source-set

This commit is contained in:
Paul-Christian Volkmer 2023-08-08 15:16:58 +02:00
parent 4051b5094c
commit b75328b74d
4 changed files with 22 additions and 2 deletions

View File

@ -15,6 +15,18 @@ java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
} }
sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
}
val integrationTestImplementation: Configuration by configurations.getting {
extendsFrom(configurations.testImplementation.get())
extendsFrom(configurations.runtimeOnly.get())
}
configurations { configurations {
compileOnly { compileOnly {
extendsFrom(configurations.annotationProcessor.get()) extendsFrom(configurations.annotationProcessor.get())
@ -50,8 +62,8 @@ dependencies {
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test") testImplementation("io.projectreactor:reactor-test")
testImplementation("org.testcontainers:junit-jupiter") integrationTestImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:postgresql") integrationTestImplementation("org.testcontainers:postgresql")
} }
tasks.withType<KotlinCompile> { tasks.withType<KotlinCompile> {
@ -65,3 +77,11 @@ tasks.withType<Test> {
useJUnitPlatform() useJUnitPlatform()
} }
task<Test>("integrationTest") {
description = "Runs integration tests"
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter("test")
}