https://kotlinlang.org logo
#ktor
Title
# ktor
m

Mati Galli

08/11/2022, 7:02 PM
Hi guys! I’m migrating my project to ktor 2.0 with kotlin 1.7 and I’m having troubles with a
test task
configured on my
build.gradle.kts
. It seems that the tests are passing, but an exception is thrown anyway
Copy code
2022-08-11T15:46:14.822-0300 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':domain:test'.
Copy code
[org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.api.tasks.VerificationException: There were failing tests. See the report at
My configuration
Copy code
plugins {
    jacoco
    base
    kotlin("jvm") version "1.7.10"
    id("io.gitlab.arturbosch.detekt") version "1.15.0"
    id("org.sonarqube") version "3.0"
}

buildscript {
    repositories { mavenCentral() }

    dependencies {
        classpath(kotlin("gradle-plugin", version = "1.7.10"))
        classpath(kotlin("serialization", version = "1.5.30"))
    }
}

subprojects {
    dependencies {
        implementation("io.insert-koin:koin-ktor:$koinVersion")
       testImplementation("io.mockk:mockk:$mockkVersion")

    testImplementation("org.jetbrains.kotlin:kotlin-test:1.7.10")
        testImplementation("org.jetbrains.kotlin:kotlin-test-junit5:1.7.10")

    }

tasks.test {
        useJUnitPlatform()
    }

    tasks.build {
        dependsOn("test")
    }
}
a

Aleksei Tirman [JB]

08/12/2022, 4:15 PM
Could you please share a report for failing tests?
m

Mati Galli

08/16/2022, 6:05 PM
Hi Aleksei! Thanks for reaching out! I already fix my issue 🙂 It was a dependency to a third party library that was causing the problem! Up and running my service over ktor 2, kotlin 1.7 and gradle 7.5 😊
9 Views