lundi 21 décembre 2015

Read docs but can't make Gradle integration testing work

I have directories:

src/it/java
src/test/java
src/test/resources
src/test/fixtures
src/main/java
src/main/resources

...and I'm trying to get the integration tests in it to compile and run as well as the other code when I call gradle build. The fixtures directory can probably be ignored. There's only one file in it, it's mostly empty and has no apparent function. Further, there are no references to it elsewhere in the code.

I've been through the documentation and several examples but I seem to be having some trouble getting them to function as advertised. I have seen some successful builds but then I can't find any of the class files from the src/it/java directory and the output doesn't mention them, which I assume means they didn't run.

Currently I have:

dependencies {
//...a big boatload of dependencies
}

configurations {
  integrationTestCompile.extendsFrom testCompile
  integrationTestRuntime.extendsFrom testRuntime
}

sourceSets {
  integrationTest {
    java {
      compileClasspath += main.output + test.output
      runtimeClasspath += main.output + test.output
      srcDir file('src/it/java')
    }
    resources.srcDir file('src/it/resources')//currently no such dir
  }

Aucun commentaire:

Enregistrer un commentaire