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

Windows bat steps never fail

    XMLWordPrintable

Details

    Description

      bat steps in Jenkins never fail:

       


      pipeline
      {
      agent any

      stages
      {
      stage('Build')
      {
      steps

      { bat returnStatus: true, script: ''' EXIT 1 ''' }

      }
      }
      }


       

      (Formatting above is scrambled by Jira)

       

      ... results in:


      [Jenkins Test-Pipeline] Running batch script

      C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

      Attachments

        Activity

          settrend A. D. created issue -
          settrend A. D. made changes -
          Field Original Value New Value
          Summary Windows bat step never fails Windows bat steps never fail
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline
          {
             agent any

            stages
            {
            stage('Build')
               {
                 steps
                 {
                   bat returnStatus: true, script: '''
                   EXIT 1
                   '''
                 }
               }
            }
          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
          {color:#c1c7d0}[Pipeline] }{color}
          {color:#c1c7d0}[Pipeline] // stage{color}
          {color:#c1c7d0}[Pipeline] }{color}
          {color:#c1c7d0}[Pipeline] // node{color}
          {color:#c1c7d0}[Pipeline] End of Pipeline{color}
          Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          {{pipeline}}
          {{ {}}
          {{   agent any}}{{  stages}}
          {{   {}}
          {{  stage('Build')}}
          {{     {}}
          {{      steps}}
          {{      }}{{{}}
          {{        bat returnStatus: true, script: '''}}
          {{        EXIT 1}}
          {{        '''}}
          {{      }}}
          {{    }}}
          {{   }}}
          {{ }}}
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          {{pipeline}}
          {{ {}}
          {{   agent any}}{{  stages}}
          {{   {}}
          {{  stage('Build')}}
          {{     {}}
          {{      steps}}
          {{      }}{{{}}
          {{        bat returnStatus: true, script: '''}}
          {{        EXIT 1}}
          {{        '''}}
          {{      }}}
          {{    }}}
          {{   }}}
          {{ }}}
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline
          {
             agent any

            stages
            {
               stage('Build')
              {
                 steps
                {
                  bat returnStatus: true, script: '''
                  EXIT 1
                  '''
                 }
               }
            }
          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline
          {
             agent any

            stages
            {
               stage('Build')
              {
                 steps
                {
                  bat returnStatus: true, script: '''
                  EXIT 1
                  '''
                 }
               }
            }
          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
             agent any

            stages
             {
               stage('Build')
               {
                 steps
                 {
                  bat returnStatus: true, script: '''
                   EXIT 1
                   '''
                  }
               }
             }
           }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
             agent any

            stages
             {
               stage('Build')
               {
                 steps
                 {
                  bat returnStatus: true, script: '''
                   EXIT 1
                   '''
                  }
               }
             }
           }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline

          {

            agent any

           

            stages

            {

              stage('Build')

              {

                steps

             {

                  bat returnStatus: true, script: '''

                  EXIT 1

                  '''

                 }

               }

            }

          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline

          {

            agent any

           

            stages

            {

              stage('Build')

              {

                steps

             {

                  bat returnStatus: true, script: '''

                  EXIT 1

                  '''

                 }

               }

            }

          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline

          {

            agent any

           

            stages

            {

              stage('Build')

              {

                steps

            

          {         bat returnStatus: true, script: '''\

                  EXIT 1\

                  '''\

                 }

               }

            }

          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline

          {

            agent any

           

            stages

            {

              stage('Build')

              {

                steps

            

          {         bat returnStatus: true, script: '''\

                  EXIT 1\

                  '''\

                 }

               }

            }

          }
          ----
           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline
          {
           agent any

          stages
           {
           stage('Build')
           {
           steps
           {
           bat returnStatus: true, script: '''
           EXIT 1
           '''
           }
           }
           }
          }


           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline
          {
           agent any

          stages
           {
           stage('Build')
           {
           steps
           {
           bat returnStatus: true, script: '''
           EXIT 1
           '''
           }
           }
           }
          }


           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
           agent any

          stages
           {
           stage('Build')
           {
           steps

          { bat returnStatus: true, script: '" EXIT 1 '" }

          }
           }
           }

           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
           agent any

          stages
           {
           stage('Build')
           {
           steps

          { bat returnStatus: true, script: '" EXIT 1 '" }

          }
           }
           }

           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
           agent any

          stages
           {
           stage('Build')
           {
           steps

          { bat returnStatus: true, script: '"

          EXIT 1

          '" }

          }
           }
           }

           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          settrend A. D. made changes -
          Description bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
           agent any

          stages
           {
           stage('Build')
           {
           steps

          { bat returnStatus: true, script: '"

          EXIT 1

          '" }

          }
           }
           }

           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          bat steps in Jenkins never fail:

           
          ----
          pipeline
           {
           agent any

          stages
           {
           stage('Build')
           {
           steps

          { bat returnStatus: true, script: ''' EXIT 1 ''' }

          }
           }
           }
          ----
           

          *{color:#de350b}(Formatting above is scrambled by Jira){color}*

           

          ... results in:
          ----
          [Jenkins Test-Pipeline] Running batch script

          C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>EXIT 1
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // stage{color}
           {color:#c1c7d0}[Pipeline] }{color}
           {color:#c1c7d0}[Pipeline] // node{color}
           {color:#c1c7d0}[Pipeline] End of Pipeline{color}
           Finished: *SUCCESS*
          danielbeck Daniel Beck made changes -
          Component/s workflow-durable-task-step-plugin [ 21715 ]
          Component/s core [ 15593 ]
          danielbeck Daniel Beck made changes -
          Issue Type Improvement [ 4 ] Bug [ 1 ]
          danielbeck Daniel Beck made changes -
          Priority Blocker [ 1 ] Major [ 3 ]

          This is expected behavior, read documentation on returnStatus parameter:

           

          Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code.

          slonopotamusorama Marat Radchenko added a comment - This is expected behavior, read documentation on returnStatus parameter :   Normally, a script which exits with a nonzero status code will cause the step to fail with an exception. If this option is checked, the return value of the step will instead be the status code.
          slonopotamusorama Marat Radchenko made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Closed [ 6 ]

          People

            Unassigned Unassigned
            settrend A. D.
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: