title: Gradle integration test building but not running
body: <p>I'm setting up a multi module gradle project and trying to separate integration tests for all subprojects. I've managed to create integTest task and I can see it builds the integration test classes and creates integration test reports in different directories to the unit tests. It isn't however running my integration test.</p>
  
  <p>Project structure is something like</p>
  
  <pre><code>|_ gradle
  | |_ integration-test.gradle
  |_ subproject
  | |_ src
  | |  |_ main
  | |  | |_ java
  | |  | |_ resources
  | |  |_ test
  | |  | |_ java
  | |  | |_ resources
  | |  |_ integTest
  | |    |_ java
  | |    | |_sit
  | |    |   |_ MyTest.java
  | |    |_ resources
  | |_ build.gradle
  |_ build.gradle
  |_ gradle.properties
  |_ settings.gradle
  </code></pre>
  
  <p>In the integration-test.gradle I have</p>
  
  <pre><code>sourceSets {
      integTest {
          java.srcDir file('src/integTest/java')
          resources.srcDir file('src/integTest/resources')
          compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
          runtimeClasspath += output + compileClasspath
      }
  }
  
  dependencies {
      integTestCompile sourceSets.main.output
      integTestCompile sourceSets.test.output 
  
      integTestCompile configurations.compile
      integTestCompile configurations.testCompile 
  
      integTestRuntime configurations.runtime
      integTestRuntime configurations.testRuntime 
  }
  
  task integTest(type: Test) {
      group = LifecycleBasePlugin.VERIFICATION_GROUP
      description = 'Runs the integration tests.' 
  
      maxHeapSize = '1024m' 
  
      testClassesDir = sourceSets.integTest.output.classesDir
      classpath = sourceSets.integTest.runtimeClasspath 
  
      binResultsDir = file("$buildDir/integration-test-results/binary/integTest")
  
      reports { 
          html.destination = "$buildDir/reports/integration-test"
          junitXml.destination = "$buildDir/integration-test-results"
      }
  
      mustRunAfter tasks.test
  }
  
  check.dependsOn integTest
  </code></pre>
  
  <p>And then in the subproject build.gradle I add the following at the top</p>
  
  <pre><code>apply from: "$rootDir/gradle/integration-test.gradle"
  </code></pre>
  
  <p>After running <code>gradle clean build</code> I can see the unit tests building and running and see the test reports afterwards. I can also see that the integration tests are building in a separate integTest directory underneath the classes in the build dir. I can also see a new integration-test-results directory created in the build directory, however the tests defined in MyTest.java are not running</p>
  
  <p>I also see this in the console when running with the -i flag</p>
  
  <pre><code>&gt; Task :javaproject:integTest
  Task ':javaproject:integTest' is not up-to-date because:
    Output property 'binResultsDir' file E:\dev\java\workspace\javaproject\subproject\build\integration-test-results\binary\integTest has been removed.
    Output property 'binResultsDir' file E:\dev\java\workspace\javaproject\subproject\build\integration-test-results\binary\integTest\output.bin has been removed.
    Output property 'binResultsDir' file E:\dev\java\workspace\javaproject\subproject\build\integration-test-results\binary\integTest\output.bin.idx has been removed.
  Finished generating test XML results (0.0 secs) into: E:\dev\java\workspace\javaproject\subproject\build\integration-test-results
  Generating HTML test report...
  Finished generating test html results (0.006 secs) into: E:\dev\java\workspace\javaproject\subproject\build\reports\integration-test
  :javaproject:integTest (Thread[Task worker for ':',5,main]) completed. Took 0.092 secs.
  :javaproject:check (Thread[Task worker for ':',5,main]) started.
  </code></pre>