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

Mark stages as failed doesn't work when using Utils.markStageFailedAndContinued

      Hello. I am trying to mark stage as failed, but without printing "ERROR:".

      I've tried this code:

      import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
      stage('I am skipped') {
         echo "before"
         Utils.markStageSkippedForConditional(STAGE_NAME)
         echo "after"
      }

      But still stage is marked as success.

      I've tried these 4:

      Utils.markStageFailedAndContinued - marked as success
      Utils.markStageSkippedForFailure - marked as success
      Utils.markStageSkippedForUnstable - marked as success
      Utils.markStageSkippedForConditional - marked as skipped

       

      Looks like Utils.markStageSkippedForConditional works but the rest of them doesn't.

       

      Any help would be appreciated.

       

       

          [JENKINS-62512] Mark stages as failed doesn't work when using Utils.markStageFailedAndContinued

          Vlad Uros created issue -
          Vlad Uros made changes -
          Description Original: Hello. I am trying to mark stage as failed, but without printing "ERROR:".

          I've tried this code:
          {code:java}
          import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
          stage('I am skipped') {
             echo "before"
             Utils.markStageSkippedForConditional(STAGE_NAME)
             echo "after"
          }{code}
          But still stage is mark as success.

          I've tried these 4:

          Utils.markStageFailedAndContinued - marked as success
          Utils.markStageSkippedForFailure - marked as success
          Utils.markStageSkippedForUnstable - marked as success
          Utils.markStageSkippedForConditional - marked as skipped

           

          Looks like Utils.markStageSkippedForConditional works but the rest of them doesn't.

           

          Any help would be appreciated.

           

           
          New: Hello. I am trying to mark stage as failed, but without printing "ERROR:".

          I've tried this code:
          {code:java}
          import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
          stage('I am skipped') {
             echo "before"
             Utils.markStageSkippedForConditional(STAGE_NAME)
             echo "after"
          }{code}
          But still stage is marked as success.

          I've tried these 4:

          Utils.markStageFailedAndContinued - marked as success
           Utils.markStageSkippedForFailure - marked as success
           Utils.markStageSkippedForUnstable - marked as success
           Utils.markStageSkippedForConditional - marked as skipped

           

          Looks like Utils.markStageSkippedForConditional works but the rest of them doesn't.

           

          Any help would be appreciated.

           

           
          Vladyslav Kovalov made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]
          Mark Waite made changes -
          Assignee Original: Sam Van Oort [ svanoort ]

            Unassigned Unassigned
            vladaurosh Vlad Uros
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: