title: How to create separate tests with Gradle and Kotlin?
body: <p>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.</p>
  
  <p>I am using Gradle 4.5 and my build.gradle file looks something like this :</p>
  
  <pre><code>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'
  }
  </code></pre>
  
  <p>I have tried the <a href="https://www.petrikainulainen.net/programming/gradle/getting-started-with-gradle-integration-testing-with-the-testsets-plugin/" rel="nofollow noreferrer">method described here</a> 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.</p>
  
  <p>What can i do ?</p>
  
  <h2>Edit :</h2>
  
  <p>Here is the result of <code>gradle clean integTest</code> with the solution of @lance-java:</p>
  
  <pre><code>: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
  </code></pre>
  
  <p>So nothing is executed (I make sure that the tests are supposed to fail)</p>