Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39464

Pipeline with parallel and no stages does not get visualised correctly

    Details

    • Similar Issues:
    • Sprint:
      tethys

      Description

      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'
      		}
      	}
      }
      

      Result looks like this:

        Attachments

          Issue Links

            Activity

            michaelneale Michael Neale created issue -
            michaelneale Michael Neale made changes -
            Field Original Value New Value
            Description 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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}
            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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            Suggested solution: in this case put a virtual "stage('parrallel') {...}" around it - then the visualisation is correct (3 dots in a column)
            michaelneale Michael Neale made changes -
            Epic Link JENKINS-35759 [ 171771 ]
            jamesdumay James Dumay made changes -
            Sprint tasman [ 136 ]
            jamesdumay James Dumay made changes -
            Link This issue duplicates JENKINS-39628 [ JENKINS-39628 ]
            jamesdumay James Dumay made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            jamesdumay James Dumay made changes -
            Resolution Duplicate [ 3 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            jamesdumay James Dumay made changes -
            Description 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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            Suggested solution: in this case put a virtual "stage('parrallel') {...}" around it - then the visualisation is correct (3 dots in a column)
            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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            *Suggested solution*
            * Pipeline beings with a start dot (as done in JENKINS-39628)
            * Lines off of the start dot connected to the parallels
            jamesdumay James Dumay made changes -
            Sprint tasman [ 136 ] frank [ 156 ]
            jamesdumay James Dumay made changes -
            Sprint frank [ 156 ] tethys [ 161 ]
            jamesdumay James Dumay made changes -
            Rank Ranked lower
            jamesdumay James Dumay made changes -
            Description 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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            *Suggested solution*
            * Pipeline beings with a start dot (as done in JENKINS-39628)
            * Lines off of the start dot connected to the parallels
            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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            jamesdumay James Dumay made changes -
            Assignee Josh McDonald [ sophistifunk ]
            jamesdumay James Dumay made changes -
            Sprint tethys [ 161 ] kraken [ 166 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Link This issue is duplicated by JENKINS-40458 [ JENKINS-40458 ]
            jamesdumay James Dumay made changes -
            Description 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)

            The pipeline below results in this visualisation:

             !Screen Shot 2016-11-03 at 12.24.11 pm.png|thumbnail!

            The pipeline:

            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            *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)

            *Visualisation*
            The pipeline below results in this visualisation:
             !Screen Shot 2016-11-03 at 12.24.11 pm.png!

            *Example*
            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work corr
            jamesdumay James Dumay made changes -
            Description *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)

            *Visualisation*
            The pipeline below results in this visualisation:
             !Screen Shot 2016-11-03 at 12.24.11 pm.png!

            *Example*
            {noformat}
            parallel(lint: {
                        node {
                            echo "yeah"
                        }
                    },
                    verifyZoneFiles: {
                        node {
                            echo "yeah"
                        }

                    },
                    rspec: {
                        node {
                            echo "yeah"
                        }

                    },
                )
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work corr
            *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            jamesdumay James Dumay made changes -
            Attachment snap.png [ 35177 ]
            jamesdumay James Dumay made changes -
            Description *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png|thumbnail!
            jamesdumay James Dumay made changes -
            Description *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png|thumbnail!
            *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png!
            jamesdumay James Dumay made changes -
            Assignee Josh McDonald [ sophistifunk ]
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-35759 [ 171771 ] JENKINS-35750 [ 171713 ]
            jamesdumay James Dumay made changes -
            Summary pipeline with parallel but not stages shows up only first branch Pipeline with parallel and no stages does not get visualised correctly
            jamesdumay James Dumay made changes -
            Remote Link This issue links to "[Blue Ocean] Stages in parallel not being displayed correctly (Web Link)" [ 15132 ]
            jlpinardon jlpinardon made changes -
            Attachment BrokenPipelineDisplay.png [ 35216 ]
            jlpinardon jlpinardon made changes -
            Attachment AwaitedDisplay.png [ 35217 ]
            jlpinardon jlpinardon made changes -
            Attachment stagesNestedinParallel.xml [ 35218 ]
            jlpinardon jlpinardon made changes -
            Attachment Legacy with duration error.png [ 35219 ]
            jlpinardon jlpinardon made changes -
            Attachment Display During run.png [ 35220 ]
            jamesdumay James Dumay made changes -
            Link This issue relates to JENKINS-38442 [ JENKINS-38442 ]
            jamesdumay James Dumay made changes -
            Link This issue duplicates JENKINS-39628 [ JENKINS-39628 ]
            jamesdumay James Dumay made changes -
            Sprint kraken [ 166 ] post-release [ 181 ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            jamesdumay James Dumay made changes -
            Description *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png!
            *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png!

            *Other examples*
            {code}
            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'
            }
            }
            }
            {code}
            jamesdumay James Dumay made changes -
            Attachment image.png [ 35369 ]
            jamesdumay James Dumay made changes -
            Description *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png!

            *Other examples*
            {code}
            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'
            }
            }
            }
            {code}
            *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*
            {noformat}
            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"'
                        }
                    }
            }
            {noformat}

            *Workaround*
            Simply wrap the parallels in a {{stage}} and it will work correctly.

            {code}
            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"'
                          }
                      }
              }
            }
            {code}

            It will then be visualised like:
             !snap.png!

            *Other examples*

            _Parallel defined between stages but not nested in its own stage_
            {code}
            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'
            }
            }
            }
            {code}

            Result looks like this:
             !image.png|thumbnail!
            jamesdumay James Dumay made changes -
            Sprint post-release [ 181 ] tethys [ 161 ]
            jamesdumay James Dumay made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            jamesdumay James Dumay made changes -
            Assignee Vivek Pandey [ vivek ]
            jamesdumay James Dumay made changes -
            Rank Ranked higher
            vivek Vivek Pandey made changes -
            Status Reopened [ 4 ] In Progress [ 3 ]
            vivek Vivek Pandey made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            vivek Vivek Pandey made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            mac110 Alex S. made changes -
            Rank Ranked higher
            chenrici Christoph Henrici made changes -
            Status Resolved [ 5 ] In Review [ 10005 ]
            chenrici Christoph Henrici made changes -
            Status In Review [ 10005 ] In Progress [ 3 ]
            tsvi Tsvi Mostovicz made changes -
            trane9991 Taras Postument made changes -
            Link This issue is related to JENKINS-53751 [ JENKINS-53751 ]

              People

              • Assignee:
                vivek Vivek Pandey
                Reporter:
                michaelneale Michael Neale
              • Votes:
                8 Vote for this issue
                Watchers:
                23 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: