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

mazorius

06/30/2021, 9:51 AM
Hi, I got issues by using kotest 4.6.0 together with Gradle 7.1-all.
I run
Copy code
./gradlew classes testClasses integrationTestClasses --rerun-tasks --console verbose
and got this inside the logs:
Copy code
> Task :compileKotlin
> Task :compileJava NO-SOURCE
> Task :pluginDescriptors
> Task :processResources
> Task :classes

> Task :compileTestKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-common-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-jdk7-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-jdk8-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-reflect-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.0/65fbc439df2e4aad1f3769762d54534f1b564090/kotlin-stdlib-jdk8-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/63db9d66c3d20f7b8f66196e7ba86969daae8b8a/kotlin-reflect-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.0/f61904618ea7be07a66e0545ffe8dc2c70a19b77/kotlin-stdlib-jdk7-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.0/29dae2501ca094416d15af0e21470cb634780444/kotlin-stdlib-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.0/4080d69efca5e39e9b4972f125e40f1607bd6460/kotlin-stdlib-common-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.5.0/a2d66828077376fc1851a6fdbf25865935f4101d/kotlin-script-runtime-1.5.0.jar (version 1.5)
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE

> Task :compileIntegrationTestKotlin
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-common-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-jdk7-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-stdlib-jdk8-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/wrapper/dists/gradle-7.1-all/1nmi34k5kbm49vjut323hp5gt/gradle-7.1/lib/kotlin-reflect-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.31/e613be5465ef1e6fd0468707690b7ebf625ea2fe/kotlin-stdlib-jdk8-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.31/84ce8e85f6e84270b2b501d44e9f0ba6ff64fa71/kotlin-stdlib-jdk7-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.31/a58e0fb9812a6a93ca24b5da75e4b5a0cb89c957/kotlin-stdlib-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.31/6dd50665802f54ba9bc3f70ecb20227d1bc81323/kotlin-stdlib-common-1.4.31.jar (version 1.4)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.0/65fbc439df2e4aad1f3769762d54534f1b564090/kotlin-stdlib-jdk8-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.5.0/47806fe8ed30dbdf9e697eda5e9c9a3905ff3363/kotlin-reflect-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.5.0/f61904618ea7be07a66e0545ffe8dc2c70a19b77/kotlin-stdlib-jdk7-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.5.0/29dae2501ca094416d15af0e21470cb634780444/kotlin-stdlib-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.0/4080d69efca5e39e9b4972f125e40f1607bd6460/kotlin-stdlib-common-1.5.0.jar (version 1.5)
    /Users/rg/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.5.0/a2d66828077376fc1851a6fdbf25865935f4101d/kotlin-script-runtime-1.5.0.jar (version 1.5)
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

> Task :compileIntegrationTestJava NO-SOURCE
> Task :processIntegrationTestResources
> Task :integrationTestClasses

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See <https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings>

BUILD SUCCESSFUL in 5s
6 actionable tasks: 6 executed
I need to add this:
Copy code
testImplementation(enforcedPlatform("org.jetbrains.kotlin:kotlin-bom:1.4.31"))
to solve that. But I think that should not happen or?
I added kotest that way:
Copy code
val koTestVersion = "4.6.0"
  testImplementation("io.kotest:kotest-runner-junit5:$koTestVersion")
  testImplementation("io.kotest:kotest-assertions-core:$koTestVersion")
  testImplementation("io.kotest:kotest-property:$koTestVersion")
w

wasyl

06/30/2021, 10:00 AM
Do you mean the warnings? This is an issue in Gradle, basically
Gradle bundles specific version of Kotlin and complains if something else on the build classpath pulls a different version. Bottom line is: as long as everything works, the warnings can be safely ignored
4 Views