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

vSphere build steps declare success on failure

XMLWordPrintable

      Build steps that fail should declare themselves to have failed and cause the build to go red and fail.
      At present, if one has a vSphere "Deploy VM from Template" step and it's told to create a new VM called "foo" from a master image "bar" (when you don't have an image "foo" or "bar") then it'll fail, but declare success.
      e.g.

      Console Output
      Started by user a.nonymous@somewhere.com
      [EnvInject] - Loading node environment variables.
      Building on master in workspace /var/jenkins_home/workspace/Test
      [vSphere]
      [vSphere] Performing vSphere build step: "Deploy VM from template"
      [vSphere] Attempting to use server configuration: "my_vsphere"
      [vSphere] Deploying new vm "foo" from template "bar"
      Finished: SUCCESS

      I've checked the code and there are two "perform" methods.
      The code should be refactored so that the parent class provides all the "perform" methods needed except one, such that the child classes (the actual build steps like Deploy.java) only have to implement one "perform" method and all other code paths in will end up calling their one-and-only "perform" method.
      Once refactored, the code should be changed so that any exceptions or failures result in the build going red, with exception traces if appropriate. Anywhere where such an uncompromising attitude to failure is questionable should be enhanced with a tick-box "ignore failure" option that's ticked by default if the original code suppressed failures.

            Unassigned Unassigned
            pjdarton pjdarton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: