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

Not failing on error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Not A Defect
    • Component/s: msbuild-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.46.2
      MSbuild Plugin 1.27
      MSBuild version 14.0
    • Similar Issues:

      Description

      I have a MSBuild project that batch processes a list of projects and I have the task set there to ContinueOnError as I need all the projects to be compiled.

      In Jenkins I DO NOT have the Plugin configured to Continue Job on build Failure.

      During build an error occurs but the failure is not Failing the build when MSBuild is done and returns to Jenkins the Plugin is not failing out.

      MSBuild is reporting 12 Errors on exit but the plugin just lets the job continue, job status at that time is also not Failure. 

      These particular errors are somewhat unusual as they are from Postsharp and have a line that beings like this:
      20>unknown : error : error: Unhandled exception
      Not sure if that is the issue or not. 

       

       

        Attachments

          Activity

          Hide
          marshall777 Lionel Cabasson added a comment -

          Hello,

          I think that since your msbuild task is set to continue on error, msbuild return code is 0 (success) even when one of the build failed. The plugin checks this return code to determine if msbuild succeeded or failed so it thinks there were no error and let the build process continue.

          You could either alter your msbuild project so that it returns an error when one of the build has failed or maybe take a look at some other Jenkins plugins that would fail the build based on some regex when postsharp errors appear.

          Show
          marshall777 Lionel Cabasson added a comment - Hello, I think that since your msbuild task is set to continue on error, msbuild return code is 0 (success) even when one of the build failed. The plugin checks this return code to determine if msbuild succeeded or failed so it thinks there were no error and let the build process continue. You could either alter your msbuild project so that it returns an error when one of the build has failed or maybe take a look at some other Jenkins plugins that would fail the build based on some regex when postsharp errors appear.
          Hide
          jstarbird Jon Starbird added a comment -

          This was me not using the MSBuild ContinueOnError correctly with newer MSBuild. I was not aware they had enhanced that feature.

          I changed it to ContinueOnErrror=ErrorAndContinue and this makes everything work as needed.

           

          Show
          jstarbird Jon Starbird added a comment - This was me not using the MSBuild ContinueOnError correctly with newer MSBuild. I was not aware they had enhanced that feature. I changed it to ContinueOnErrror=ErrorAndContinue and this makes everything work as needed.  
          Hide
          marshall777 Lionel Cabasson added a comment -

          Glad you found a solution. Thanks for sharing it.

          Show
          marshall777 Lionel Cabasson added a comment - Glad you found a solution. Thanks for sharing it.

            People

            Assignee:
            marshall777 Lionel Cabasson
            Reporter:
            jstarbird Jon Starbird
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: