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

FindBugs does not trigger the build to fail on found issue

    Details

    • Similar Issues:
    • Released As:
      5.0.0-beta2

      Description

      Although, I set the FindBugs Jenkins Plugin to "Compute new warnings (based on the last successful build unless another reference build is chosen below)" and fail on 1 found high priority issue, it does not fail. Here is the output:

      [findbugs] Executing SpotBugs FindBugsTask from ant task
      [findbugs] Running SpotBugs...

      [findbugs] Warnings generated: 361
      [findbugs] Calculating exit code...
      [findbugs] Setting 'bugs found' flag (1)
      [findbugs] Exit code set to: 1
      [findbugs] Java Result: 1
      [findbugs] Output saved to findbugs.xml

      BUILD SUCCESSFUL
      Total time: 2 minutes 32 seconds

      [FINDBUGS] Collecting findbugs analysis files...

      [FINDBUGS] Searching for all files in .... that match the pattern **/findbugs.xml
      [FINDBUGS] Parsing 1 file in ....
      [FINDBUGS] Successfully parsed file ....\findbugs.xml with 360 unique warnings and 1 duplicate.
      Skipping warnings blame since Git is the only supported SCM up to now.%n
      [FINDBUGS] Computing warning deltas based on reference build #195
      [FINDBUGS] Plug-in Result: Success - no threshold has been exceeded

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          Does the UI for the project show new warnings? Seems that there are no new warnings. Or how many warnings are in build #195?

          Show
          drulli Ulli Hafner added a comment - Does the UI for the project show new warnings? Seems that there are no new warnings. Or how many warnings are in build #195?
          Hide
          rady66 Radoslav Ivanov added a comment -

          1. Yep, there is one new bug reported (please note the attachment)
           - the plugin settings are to compare with previous build and if there is 1 high, then to fail.
           
          2. Build #195 output:

           [findbugs] Executing SpotBugs FindBugsTask from ant task
           [findbugs] Running SpotBugs...
           [findbugs] Warnings generated: 360
           [findbugs] Calculating exit code...
           [findbugs] Setting 'bugs found' flag (1)
           [findbugs] Exit code set to: 1
           [findbugs] Java Result: 1
           [findbugs] Output saved to findbugs.xml

          BUILD SUCCESSFUL
          Total time: 3 minutes 8 seconds
          [FINDBUGS] Collecting findbugs analysis files...
          [FINDBUGS] Searching for all files in ... that match the pattern **/findbugs.xml
          [FINDBUGS] Parsing 1 file in ....
          [FINDBUGS] Successfully parsed file ....\findbugs.xml with 359 unique warnings and 1 duplicate.
          Skipping warnings blame since Git is the only supported SCM up to now.%n
          [FINDBUGS] Computing warning deltas based on reference build #194
          [FINDBUGS] Plug-in Result: Success - no threshold has been exceeded

          Show
          rady66 Radoslav Ivanov added a comment - 1. Yep, there is one new bug reported (please note the attachment)  - the plugin settings are to compare with previous build and if there is 1 high, then to fail.   2. Build #195 output:   [findbugs] Executing SpotBugs FindBugsTask from ant task   [findbugs] Running SpotBugs...   [findbugs] Warnings generated: 360   [findbugs] Calculating exit code...   [findbugs] Setting 'bugs found' flag (1)   [findbugs] Exit code set to: 1   [findbugs] Java Result: 1   [findbugs] Output saved to findbugs.xml BUILD SUCCESSFUL Total time: 3 minutes 8 seconds [FINDBUGS] Collecting findbugs analysis files... [FINDBUGS] Searching for all files in ... that match the pattern **/findbugs.xml [FINDBUGS] Parsing 1 file in .... [FINDBUGS] Successfully parsed file ....\findbugs.xml with 359 unique warnings and 1 duplicate. Skipping warnings blame since Git is the only supported SCM up to now.%n [FINDBUGS] Computing warning deltas based on reference build #194 [FINDBUGS] Plug-in Result: Success - no threshold has been exceeded
          Hide
          drulli Ulli Hafner added a comment - - edited

          Did you change the texts in the screenshot above? The text in the plugin should report New Warnings and not New this build?

          And the one new bug has priority high?

          Can you please add the part of your config.xml (in your Jenkins jobs folder) that contains the thresholds configuration, I looks like:

          <thresholds plugin="analysis-core@1.88-SNAPSHOT">
                  <unstableTotalAll></unstableTotalAll>
                  <unstableTotalHigh></unstableTotalHigh>
                  <unstableTotalNormal></unstableTotalNormal>
                  <unstableTotalLow></unstableTotalLow>
                  <unstableNewAll></unstableNewAll>
                  <unstableNewHigh></unstableNewHigh>
                  <unstableNewNormal></unstableNewNormal>
                  <unstableNewLow></unstableNewLow>
                  <failedTotalAll></failedTotalAll>
                  <failedTotalHigh></failedTotalHigh>
                  <failedTotalNormal></failedTotalNormal>
                  <failedTotalLow></failedTotalLow>
                  <failedNewAll></failedNewAll>
                  <failedNewHigh></failedNewHigh>
                  <failedNewNormal></failedNewNormal>
                  <failedNewLow></failedNewLow>
                </thresholds>
          
          Show
          drulli Ulli Hafner added a comment - - edited Did you change the texts in the screenshot above? The text in the plugin should report New Warnings and not New this build ? And the one new bug has priority high? Can you please add the part of your config.xml (in your Jenkins jobs folder) that contains the thresholds configuration, I looks like: <thresholds plugin="analysis-core@1.88-SNAPSHOT"> <unstableTotalAll></unstableTotalAll> <unstableTotalHigh></unstableTotalHigh> <unstableTotalNormal></unstableTotalNormal> <unstableTotalLow></unstableTotalLow> <unstableNewAll></unstableNewAll> <unstableNewHigh></unstableNewHigh> <unstableNewNormal></unstableNewNormal> <unstableNewLow></unstableNewLow> <failedTotalAll></failedTotalAll> <failedTotalHigh></failedTotalHigh> <failedTotalNormal></failedTotalNormal> <failedTotalLow></failedTotalLow> <failedNewAll></failedNewAll> <failedNewHigh></failedNewHigh> <failedNewNormal></failedNewNormal> <failedNewLow></failedNewLow> </thresholds>
          Hide
          drulli Ulli Hafner added a comment -

          BTW: Is this a freestyle job?

          Show
          drulli Ulli Hafner added a comment - BTW: Is this a freestyle job?
          Hide
          rady66 Radoslav Ivanov added a comment -

          1) Did you change the texts in the screenshot above? The text in the plugin should report New Warnings and not New this build?

             No

          2) And the one new bug has priority high?

           Yes

          3) Is this a freestyle job?

           Yes

          4) Not sure what you suggested to do with the configuration but here it is how it looks like at the moment

           

          <hudson.plugins.findbugs.FindBugsPublisher plugin="findbugs@4.71">
                <healthy></healthy>
                <unHealthy></unHealthy>
                <thresholdLimit>low</thresholdLimit>
                <pluginName>[FINDBUGS] </pluginName>
                <defaultEncoding></defaultEncoding>
                <canRunOnFailed>false</canRunOnFailed>
                <usePreviousBuildAsReference>true</usePreviousBuildAsReference>
                <useStableBuildAsReference>true</useStableBuildAsReference>
                <useDeltaValues>true</useDeltaValues>
                <thresholds plugin="analysis-core@1.92">
                  <unstableTotalAll></unstableTotalAll>
                  <unstableTotalHigh></unstableTotalHigh>
                  <unstableTotalNormal></unstableTotalNormal>
                  <unstableTotalLow></unstableTotalLow>
                  <unstableNewAll></unstableNewAll>
                  <unstableNewHigh></unstableNewHigh>
                  <unstableNewNormal></unstableNewNormal>
                  <unstableNewLow></unstableNewLow>
                  <failedTotalAll></failedTotalAll>
                  <failedTotalHigh></failedTotalHigh>
                  <failedTotalNormal></failedTotalNormal>
                  <failedTotalLow></failedTotalLow>
                  <failedNewAll></failedNewAll>
                  <failedNewHigh>1</failedNewHigh>
                  <failedNewNormal></failedNewNormal>
                  <failedNewLow></failedNewLow>
                </thresholds>
                <shouldDetectModules>false</shouldDetectModules>
                <dontComputeNew>false</dontComputeNew>
                <doNotResolveRelativePaths>false</doNotResolveRelativePaths>
                <pattern>**/findbugs.xml</pattern>
                <isRankActivated>false</isRankActivated>
                <excludePattern></excludePattern>
                <includePattern></includePattern>
              </hudson.plugins.findbugs.FindBugsPublisher>
          

          Please let me know how this problem could be overcome?

          Show
          rady66 Radoslav Ivanov added a comment - 1) Did you change the texts in the screenshot above? The text in the plugin should report New Warnings and not New this build ?    No 2) And the one new bug has priority high?  Yes 3) Is this a freestyle job?  Yes 4) Not sure what you suggested to do with the configuration but here it is how it looks like at the moment   <hudson.plugins.findbugs.FindBugsPublisher plugin= "findbugs@4.71" >       <healthy></healthy>       <unHealthy></unHealthy>       <thresholdLimit>low</thresholdLimit>       <pluginName>[FINDBUGS] </pluginName>       <defaultEncoding></defaultEncoding>       <canRunOnFailed> false </canRunOnFailed>       <usePreviousBuildAsReference> true </usePreviousBuildAsReference>       <useStableBuildAsReference> true </useStableBuildAsReference>       <useDeltaValues> true </useDeltaValues>       <thresholds plugin= "analysis-core@1.92" >         <unstableTotalAll></unstableTotalAll>         <unstableTotalHigh></unstableTotalHigh>         <unstableTotalNormal></unstableTotalNormal>         <unstableTotalLow></unstableTotalLow>         <unstableNewAll></unstableNewAll>         <unstableNewHigh></unstableNewHigh>         <unstableNewNormal></unstableNewNormal>         <unstableNewLow></unstableNewLow>         <failedTotalAll></failedTotalAll>         <failedTotalHigh></failedTotalHigh>         <failedTotalNormal></failedTotalNormal>         <failedTotalLow></failedTotalLow>         <failedNewAll></failedNewAll>         <failedNewHigh>1</failedNewHigh>         <failedNewNormal></failedNewNormal>         <failedNewLow></failedNewLow>       </thresholds>       <shouldDetectModules> false </shouldDetectModules>       <dontComputeNew> false </dontComputeNew>       <doNotResolveRelativePaths> false </doNotResolveRelativePaths>       <pattern>**/findbugs.xml</pattern>       <isRankActivated> false </isRankActivated>       <excludePattern></excludePattern>       <includePattern></includePattern>     </hudson.plugins.findbugs.FindBugsPublisher> Please let me know how this problem could be overcome?
          Hide
          rady66 Radoslav Ivanov added a comment -

          Ulli Hafner, what is resolution and the fix for that? 

          Show
          rady66 Radoslav Ivanov added a comment - Ulli Hafner , what is resolution and the fix for that? 
          Hide
          drulli Ulli Hafner added a comment -

          It is part of the warnings-plugin refactoring. See wiki for details.

          Show
          drulli Ulli Hafner added a comment - It is part of the warnings-plugin refactoring . See wiki for details.
          Hide
          drulli Ulli Hafner added a comment -

          Released in 5.0.0-beta2.

          Show
          drulli Ulli Hafner added a comment - Released in 5.0.0-beta2.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              rady66 Radoslav Ivanov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: