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

Force continue build execution on failure of previous build steps

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Not A Defect
    • Component/s: gradle-plugin
    • Labels:
      None
    • Environment:
      Android
    • Similar Issues:

      Description

      In my jenkins job i have three build steps. 1st one Execute shell, 2nd gradle script to run testcases, 3rd execute shell. When i run this job, if 2nd build step is failed, jenkins is skipping the 3rd build step execution and marking the build as failure. Is there any workaround to forcefully execute the 3d build step even if the previous builds steps fails. Please help.

        Attachments

          Activity

          Hide
          nareshgunda Naresh Gunda added a comment -

          NO i was not doing that, Now i'm able to mark build as unstable. Thanks a lot.

           

          Show
          nareshgunda Naresh Gunda added a comment - NO i was not doing that, Now i'm able to mark build as unstable. Thanks a lot.  
          Hide
          wolfs Stefan Wolf added a comment -

          Do you collect the JUnit xml files via the JUnit post build action? If you do and you have failing tests your build will be marked as unstable.

          Show
          wolfs Stefan Wolf added a comment - Do you collect the JUnit xml files via the JUnit post build action ? If you do and you have failing tests your build will be marked as unstable.
          Hide
          nareshgunda Naresh Gunda added a comment -

          Stefan Wolf: Hey thanks for the solution.

          • First one worked for me too. But the problem is, this is marking the jenkins job as successful even if the testcases are failed. It would be great if the build is also marked as failure.
          • Second solution will not work in my case. Because in the second execute shell im extracting the files from android emulator. If i move execute shell to post build action, i cannot extract the files from emulator as emulator will be killed before post build action are executed.
          Show
          nareshgunda Naresh Gunda added a comment - Stefan Wolf : Hey thanks for the solution. First one worked for me too. But the problem is, this is marking the jenkins job as successful even if the testcases are failed. It would be great if the build is also marked as failure. Second solution will not work in my case. Because in the second execute shell im extracting the files from android emulator. If i move execute shell to post build action, i cannot extract the files from emulator as emulator will be killed before post build action are executed.
          Hide
          wolfs Stefan Wolf added a comment -

          You basically have two options:

          • Set ignoreFailures=true on the test tasks. See for example here.
          • You can run your shell script as a Post build step

          For me, the first option seems to be the correct choice.

          Show
          wolfs Stefan Wolf added a comment - You basically have two options: Set ignoreFailures=true  on the test tasks. See for example here . You can run your shell script as a Post build step For me, the first option seems to be the correct choice.

            People

            Assignee:
            wolfs Stefan Wolf
            Reporter:
            nareshgunda Naresh Gunda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: