parallel (
'windows': {
stage('windows tests') {
parallel (
stage('some_tests_1') {
parallel (
some_tests_1, # is a chunk of tests
)
}
stage('some_tests_2') {
parallel (
some_tests_2, # is a chunk of tests
)
}
stage('some_tests_3') {
parallel (
some_tests_3 # is a chunk of tests
)
}
)
}
'linux': ...same as above
Nestedparallel
blocks can lead to swamping your available executors, as each execution of the firstparallel
block calls multiple executions of the secondparallel
block, and so on. In general, think carefully about your parallelism and your available executors when usingparallel
.
parallel (
'windows': {
stage('windows tests') {
parallel (
some_tests_1, # is a chunk of tests
some_tests_2, # is a chunk of tests
some_tests_3 # is a chunk of tests
)
}
}
'linux': ...same as above
Don’t putstage
s inparallel
blocks - that just goes weird, breaking a lot of logic in the Stage View and elsewhere. Save yourself the pain - don't do it!
stage('Code analysis') {
steps {
parallel (
lint: {
//run lint
},
phpmd: {
//run phpmd
},
phpcs: {
//run phpcs
}
)
}
stage('Code analysis') {
parallel (
phpmd: {
//run phpmd
},
phpcs: {
//run phpcs
},
phploc: {
//run phploc
},
)
}