-
Bug
-
Resolution: Fixed
-
Major
-
None
-
-
tethys
Problem
If you have a parallel declaration, but no stages, in classic stage view nothing shows up (you just have to look at log). In blue ocean, you get a single node (stage) which shows only the first branch.
Expected behavior: should show 3 parallel branches (ideally)
Example
parallel 'branch1': { node('node1') { stage('Setup') { checkout([details removed]) } stage('Unit and Integration Tests') { bat '"my command to execute tests"' } } }, 'branch2': { node('node2') { stage('Setup') { checkout([details removed]) } stage('Unit and Integration Tests') { bat '"my command to execute tests"' } } }
Workaround
Simply wrap the parallels in a stage and it will work correctly.
stage('Build and Test') { parallel 'branch1': { node('node1') { stage('Setup') { checkout([details removed]) } stage('Unit and Integration Tests') { bat '"my command to execute tests"' } } }, 'branch2': { node('node2') { stage('Setup') { checkout([details removed]) } stage('Unit and Integration Tests') { bat '"my command to execute tests"' } } } }
It will then be visualised like:
Other examples
Parallel defined between stages but not nested in its own stage
node { stage('Checkout') { checkout scm } } parallel linux: { node('Linux') { stage('Build') { echo 'Build linux' } stage('Tests') { echo 'Tests linux' } stage('Static analysis') { echo 'Static analysis linux' } } }, windows: { node('Windows') { stage('Build') { echo 'Build windows' } stage('Tests') { echo 'Tests windows' } stage('Static analysis') { echo 'Static analysis windows' } } }
- is duplicated by
-
JENKINS-40458 Parallel pipeline not rendering properly
-
- Closed
-
- is related to
-
JENKINS-53751 The same parallel scripted and declarative pipelines rendered differently
-
- Resolved
-
- relates to
-
JENKINS-38442 View sequential stages in the pipeline visualization graph
-
- Closed
-
- links to
jlpinardon absolutely - we can't render those stage's within the parallels (see
JENKINS-38442).The reason why it doesn't show correctly after you change the structure of the Pipeline while executing is that we rely on the previous run to "preview" what the flow of the Pipeline will be. Unfortunately as Pipeline is a scripting language we can't read ahead the structure without executing it. The good news is that the new declarative syntax for Pipeline doesn't have this problem - we can read the Jenkinsfile like a config file![](/images/icons/emoticons/smile.png)
If you run it a second time you shouldn't see the problem.