From 08203430812d6ea36b9253a39e1ad33008709321 Mon Sep 17 00:00:00 2001 From: golovpavel Date: Mon, 27 Jul 2020 10:52:09 +0300 Subject: [PATCH 1/2] Added integration tests source set and task --- build.gradle.kts | 18 ++++++++++++++++++ .../rybalkinsd/kohttp/IntegrationTest.kt | 11 +++++++++++ .../rybalkinsd/kohttp/IntegrationTest.kt | 11 +++++++++++ .../rybalkinsd/kohttp/IntegrationTest.kt | 11 +++++++++++ 4 files changed, 51 insertions(+) create mode 100644 kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt create mode 100644 kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt create mode 100644 kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index b80216e1..d853e5f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,6 +31,13 @@ subprojects { val sourceSets = the() + sourceSets { + create("testIntegration") { + compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"] + runtimeClasspath += output + compileClasspath + sourceSets["test"].runtimeClasspath + } + } + if (project.name !in notToPublish) { apply(plugin = "org.jetbrains.dokka") apply(plugin = "maven-publish") @@ -105,6 +112,17 @@ subprojects { } } + tasks.register("testIntegration") { + description = "Runs the integration tests." + group = "verification" + testClassesDirs = sourceSets["testIntegration"].output.classesDirs + classpath = sourceSets["testIntegration"].runtimeClasspath + mustRunAfter(tasks["test"]) + } + + tasks.named("check") { + dependsOn("testIntegration") + } } diff --git a/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt b/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt new file mode 100644 index 00000000..68b66e1e --- /dev/null +++ b/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt @@ -0,0 +1,11 @@ +package io.github.rybalkinsd.kohttp + +import org.junit.Test + +class IntegrationTest { + + @Test + fun `stub test`() { + + } +} \ No newline at end of file diff --git a/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt b/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt new file mode 100644 index 00000000..68b66e1e --- /dev/null +++ b/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt @@ -0,0 +1,11 @@ +package io.github.rybalkinsd.kohttp + +import org.junit.Test + +class IntegrationTest { + + @Test + fun `stub test`() { + + } +} \ No newline at end of file diff --git a/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt b/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt new file mode 100644 index 00000000..68b66e1e --- /dev/null +++ b/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt @@ -0,0 +1,11 @@ +package io.github.rybalkinsd.kohttp + +import org.junit.Test + +class IntegrationTest { + + @Test + fun `stub test`() { + + } +} \ No newline at end of file From 52d84a2cecaa40e04ae2688b9b41ca1a5a37ac00 Mon Sep 17 00:00:00 2001 From: golovpavel Date: Sun, 6 Sep 2020 14:56:39 +0300 Subject: [PATCH 2/2] Fixed checkstyle warnings --- build.gradle.kts | 12 +++++++----- .../io/github/rybalkinsd/kohttp/IntegrationTest.kt | 2 +- .../io/github/rybalkinsd/kohttp/IntegrationTest.kt | 2 +- .../io/github/rybalkinsd/kohttp/IntegrationTest.kt | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d853e5f6..743f40e4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,10 +29,12 @@ subprojects { kotlinOptions.jvmTarget = "1.8" } + val testIntegrationAlias = "testIntegration" + val sourceSets = the() sourceSets { - create("testIntegration") { + create(testIntegrationAlias) { compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"] runtimeClasspath += output + compileClasspath + sourceSets["test"].runtimeClasspath } @@ -112,16 +114,16 @@ subprojects { } } - tasks.register("testIntegration") { + tasks.register(testIntegrationAlias) { description = "Runs the integration tests." group = "verification" - testClassesDirs = sourceSets["testIntegration"].output.classesDirs - classpath = sourceSets["testIntegration"].runtimeClasspath + testClassesDirs = sourceSets[testIntegrationAlias].output.classesDirs + classpath = sourceSets[testIntegrationAlias].runtimeClasspath mustRunAfter(tasks["test"]) } tasks.named("check") { - dependsOn("testIntegration") + dependsOn(testIntegrationAlias) } } diff --git a/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt b/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt index 68b66e1e..96878cf8 100644 --- a/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt +++ b/kohttp-jackson/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt @@ -8,4 +8,4 @@ class IntegrationTest { fun `stub test`() { } -} \ No newline at end of file +} diff --git a/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt b/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt index 68b66e1e..96878cf8 100644 --- a/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt +++ b/kohttp-test/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt @@ -8,4 +8,4 @@ class IntegrationTest { fun `stub test`() { } -} \ No newline at end of file +} diff --git a/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt b/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt index 68b66e1e..96878cf8 100644 --- a/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt +++ b/kohttp/src/testIntegration/kotlin/io/github/rybalkinsd/kohttp/IntegrationTest.kt @@ -8,4 +8,4 @@ class IntegrationTest { fun `stub test`() { } -} \ No newline at end of file +}