I am working on a Kotlin project with Gradle that includes unit tests. I want to add some integration tests (or functional tests, never understood the difference between the two), but I want to be able to run them independently. Ideally, the source of the tests are in different folders.
I am using Gradle 4.5 and my build.gradle file looks something like this :
buildscript { ext.kotlin_version = '1.2.21' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } apply plugin: 'kotlin' apply plugin: 'application' mainClassName = 'xyz.bobdudan.myproject.AppKt' repositories { maven { url "http://maven.stardog.com" } mavenCentral() } dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" testCompile 'io.kotlintest:kotlintest:2.0.7' } I have tried the method described here for java, but it doesn't work : the task also runs the unit tests, but they can't be found, and the integration tests are not executed at all.
What can i do ?
Edit :
Here is the result of gradle clean integTest with the solution of @lance-java:
:clean :compileIntegTestKotlin :compileIntegTestJava NO-SOURCE :processIntegTestResources NO-SOURCE :integTestClasses UP-TO-DATE :integTest NO-SOURCE Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. See https://docs.gradle.org/4.5/userguide/command_line_interface.html#sec:command_line_warnings BUILD SUCCESSFUL in 1s 2 actionable tasks: 2 executed So nothing is executed (I make sure that the tests are supposed to fail)