'How to set systemProperty in Gradle Test Suites plugin?

I am trying to run unit tests and smokes tests in parallel in gradle. I was able to achieve it with unit tests by declaring below mentioned two SystemProperties, now unit tests are running in parallel.

test { // this is main test block in build.gradle file
    useJUnitPlatform()
    systemProperty("junit.jupiter.execution.parallel.enabled", true)
    systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
    finalizedBy jacocoTestReport
}

I have used jvm test suites plugin to place all smoke tests at one place, I tried applying same systemProperty in suites block for these smoke tests but it was not working. All smoke tests are runnning sequentially only.

This is what I am trying:-

testing {
    suites {
        test {
            useJUnitJupiter()
            targets.all {
                testTask.configure {
                    systemProperty("junit.jupiter.execution.parallel.enabled", true)
                    systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
                }
            }
        }

        smokeTest(JvmTestSuite) {
            dependencies {
                implementation project
            }
        }
    }
}

If anyone got some idea. Please suggest !!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source