Last active
August 15, 2019 21:39
-
-
Save akirakw/42d834dab0a41153f844 to your computer and use it in GitHub Desktop.
An example script of parallel test on Jenkins Workflow Plugin with Gradle project, based on plugin tutorial: https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md#creating-multiple-threads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node('remote') { | |
git url: 'https://github.com/akirakw/parallel-test-executor-plugin-sample.git' , branch: 'wip/gradle' | |
stash excludes: 'target/, build/', includes: '**', name: 'source' | |
} | |
def splits = splitTests([$class: 'CountDrivenParallelism', size: 2]) | |
def branches = [:] | |
for (int i = 0; i < splits.size(); i++) { | |
def exclusions = splits.get(i); | |
branches["split${i}"] = { | |
node('remote') { | |
unstash 'source' | |
writeFile file: 'exclusions.txt', text: exclusions.join("\n") | |
sh "./gradlew -I ./exclusions.gradle clean check" | |
step([$class: 'JUnitResultArchiver', testResults: 'build/test-results/*.xml']) | |
} | |
} | |
} | |
parallel branches |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@akirakw Can you share the exclusions.gradle script?