dimanche 23 décembre 2018

Running the same Gradle task multiple times

So i have a gradle test task which runs all my tests. How can I set up gradle to run this task 100 times? It works and runs all my tests, I just need an option to choose how many times to run this.

The task in build.gradle:

test {
    // enable JUnit Platform (a.k.a. JUnit 5) support
    useJUnitPlatform()

    // set a system property for the test JVM(s)
    systemProperty 'some.prop', 'value'

    // explicitly include or exclude tests
    include 'com/company/calculator/**'

    // show standard out and standard error of the test JVM(s) on the console
    testLogging.showStandardStreams = true

    // set heap size for the test JVM(s)
    minHeapSize = "128m"
    maxHeapSize = "512m"

    // set JVM arguments for the test JVM(s)
    jvmArgs '-XX:MaxPermSize=256m'

    // listen to events in the test execution lifecycle
    beforeTest { descriptor ->
        logger.lifecycle("Running test: " + descriptor)
    }

    // Fail the 'test' task on the first test failure
    failFast = true

    // listen to standard out and standard error of the test JVM(s)
    onOutput { descriptor, event ->
        logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
    }

Aucun commentaire:

Enregistrer un commentaire