From c4c4d92429d7fac37094a282c3d8d13fcfb3377e Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Wed, 18 Jan 2017 22:56:23 +0100 Subject: [PATCH] Making work SonarQube with integration tests in different directory --- SpringJava/Gradle/build-integTest.gradle | 12 ++++++++++-- SpringJava/Gradle/build-test.gradle | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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" } -- 2.1.4