summaryrefslogtreecommitdiff
path: root/build.gradle.kts
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2023-08-08 15:16:58 +0200
committerPaul-Christian Volkmer2023-08-08 15:16:58 +0200
commitb75328b74d361b7afd6197a5b240f5f76ce2c5e0 (patch)
tree38a5aaaac74885d1a1b09910613d9a1e5a251058 /build.gradle.kts
parent4051b5094ca8daaa844803d2725b4094f3eed096 (diff)
Move integration tests into own source-set
Diffstat (limited to 'build.gradle.kts')
-rw-r--r--build.gradle.kts24
1 files changed, 22 insertions, 2 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index b59c028..89df274 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,6 +15,18 @@ java {
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 {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
@@ -50,8 +62,8 @@ dependencies {
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
- testImplementation("org.testcontainers:junit-jupiter")
- testImplementation("org.testcontainers:postgresql")
+ integrationTestImplementation("org.testcontainers:junit-jupiter")
+ integrationTestImplementation("org.testcontainers:postgresql")
}
tasks.withType<KotlinCompile> {
@@ -65,3 +77,11 @@ tasks.withType<Test> {
useJUnitPlatform()
}
+task<Test>("integrationTest") {
+ description = "Runs integration tests"
+
+ testClassesDirs = sourceSets["integrationTest"].output.classesDirs
+ classpath = sourceSets["integrationTest"].runtimeClasspath
+
+ shouldRunAfter("test")
+}