From: Gustavo Martin Morcuende Date: Wed, 18 Jan 2017 21:56:23 +0000 (+0100) Subject: Making work SonarQube with integration tests in different directory X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=c4c4d92429d7fac37094a282c3d8d13fcfb3377e;p=JavaForFun Making work SonarQube with integration tests in different directory --- diff --git a/SpringJava/Gradle/build-integTest.gradle b/SpringJava/Gradle/build-integTest.gradle index 575fc86..43604e9 100644 --- a/SpringJava/Gradle/build-integTest.gradle +++ b/SpringJava/Gradle/build-integTest.gradle @@ -2,12 +2,14 @@ sourceSets { integTest { compileClasspath += main.output + test.output runtimeClasspath += main.output + test.output + output.classesDir = test.output.classesDir + output.resourcesDir = test.output.resourcesDir } } configurations { - integTestCompile.extendsFrom testCompile - integTestRuntime.extendsFrom testRuntime + integTestCompile.extendsFrom testCompile + integTestRuntime.extendsFrom testRuntime } @@ -19,6 +21,12 @@ task integTest(type: Test) { testClassesDir = sourceSets.integTest.output.classesDir classpath = sourceSets.integTest.runtimeClasspath + reports.junitXml.destination = "${buildDir}/test-results/test" + + // explicitly include or exclude tests + filter { + includeTestsMatching "*IntegrationShould" + } testLogging { events "PASSED", "FAILED", "SKIPPED" diff --git a/SpringJava/Gradle/build-test.gradle b/SpringJava/Gradle/build-test.gradle index 3cc22f6..2d043e8 100644 --- a/SpringJava/Gradle/build-test.gradle +++ b/SpringJava/Gradle/build-test.gradle @@ -1,4 +1,8 @@ test { + + // explicitly include or exclude tests + exclude '**/*IntegrationShould.class' + testLogging { events "PASSED", "FAILED", "SKIPPED" }