ExportXMLWordPrintable

      In Jenkins' Pipeline scripting (Groovy), the 'codesonar' method has the ability to flag the build as either unstable, or failure if certain conditions are met; however, this doesn't change the result of the stage it's in.

      Since the 'codesonar' method ran successfully, I cannot encapsulate it with a 'catchError' block to change the stage result.

      I could check the build result and manually set the stage result; however, that would require me to have the codesonar stage go before any other testing stage so I can be sure that it was codesonar that made the build unstable and not unit tests or something else.

      I would prefer to be able to run the codesonar testing in parallel with all the other tests, so please fix this issue.

       

       

      Example pipeline:

      pipeline{

          stages {

              ... //Other potential stages

              stage("5) CodeSonar") {

                  steps

      {                 ... // Run analysis code here                 // When there's at least 1 additional warning, the build is marked as unstable, but stage "5) CodeSonar" is marked as success                 codesonar comparisonAnalysis: '500', conditions: [warningCountIncreaseOverall(percentage:'0',warrantedResult:'UNSTABLE')], ...             }

              }

          }

      }

            Assignee:
            gt_dbechtold
            Reporter:
            Steven
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: