I’m testing a plugin I made using gradleTestKit, based on the next sample test, I’ve noticed that the command executed when the test is ran, is gradle parallel which is OK. My question is if there is a way to configure gradle wrapper so the test will execute gradlew parallel?
private BuildResult gradle(boolean isSuccessExpected, String[] arguments = ['tasks']) {
arguments += '--stacktrace'
def runner = GradleRunner.create()
.withArguments(arguments)
.withProjectDir(testProjectDir.root)
.withPluginClasspath()
.withDebug(true)
return isSuccessExpected ? runner.build() : runner.buildAndFail()
}
private BuildResult gradle(String[] arguments = ['tasks']) {
gradle(true, arguments)
}
def "build must pass if source directory is empty"() {
buildFile << """
task parallel(type: ParallelTests) {
srcDirName = 'src/functionalTest/resources/noProps'
}
"""
when:
def result = gradle('parallel')
then:
assert result.task(":parallel").outcome == SUCCESS
}