Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

Trying to exclude Tests in one task and include in Another Task, But gradle always excludes irrespective of tasks

$
0
0

Hi ,

I have created Two Test Tasks, I need to exclude some files in one task and include those files in another task. However, gradle is always excluding while executing the task which has included.

While Executing testSuitesInclude, tests are skipping saying that no tests found.

Refer below snippet:
Gradle Version: 5.2.1

task testSuitesInclude(type: Test) {
doFirst {
compileTestJava.include("**/*abc*")
}
filter {
useTestNG() {

        useDefaultListeners = true
        options {
            scanForTestClasses = true
            suites 'src/test/resources/test.xml'
        }
    }
    testLogging {

        events "PASSED", "FAILED", "SKIPPED"
        showStandardStreams = true

    }
}

}

task testSuitesExeclude(type: Test) {
doFirst {
compileTestJava.exclude("**/*abc*")
}
filter {
useTestNG() {

        useDefaultListeners = true
        options {
            scanForTestClasses = true
            suites 'src/test/resources/test.xml'
        }
    }
    testLogging {

        events "PASSED", "FAILED", "SKIPPED"
        showStandardStreams = true

    }
}

}

My ideal goal is to stop compiling some java files in one task and same java files has to compile in another task.


Viewing all articles
Browse latest Browse all 19888

Trending Articles