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

publishCppcheck in pipeline fails job not stage

    Details

    • Similar Issues:

      Description

      When cppcheck finds an error publishCppcheck writes the following in the log:

      [Cppcheck] Starting the cppcheck analysis.
      [Cppcheck] Processing 1 files with the pattern 'cppcheck_report.xml'.
      [Cppcheck] Setting build status to FAILURE since total number of issues '1' exceeds the threshold value '0'.
      [Cppcheck] Ending the cppcheck analysis.

      but the stage it runs in is not marked as failed. I have tried using publishCppcheck in both steps and post sections and it makes no difference.

        Attachments

          Activity

          Hide
          tsondergaard tsondergaard added a comment -

          This is still a problem. Is there anything I can do to help?

          Show
          tsondergaard tsondergaard added a comment - This is still a problem. Is there anything I can do to help?
          Hide
          tsondergaard tsondergaard added a comment -

          Some information that I believe is relevant:

          Specifically it looks from the junit-plugin pull request that something like this will mark the step failed:

          FlowNode node = getContext().get(FlowNode.class);
          node.addOrReplaceAction(new WarningAction(Result.FAILURE).withMessage("<Some explanation here>"));
          

          I think stuff like that simply has to be added in CppcheckPublisher.perform().

          Show
          tsondergaard tsondergaard added a comment - Some information that I believe is relevant: https://www.jenkins.io/blog/2019/07/05/jenkins-pipeline-stage-result-visualization-improvements/ https://groups.google.com/forum/#!msg/jenkinsci-dev/5A7U1KmfX08/IP5Bg_OaAgAJ https://github.com/jenkinsci/junit-plugin/pull/118 Specifically it looks from the junit-plugin pull request that something like this will mark the step failed: FlowNode node = getContext().get(FlowNode.class); node.addOrReplaceAction( new WarningAction(Result.FAILURE).withMessage( "<Some explanation here>" )); I think stuff like that simply has to be added in CppcheckPublisher.perform().

            People

            • Assignee:
              marcosteffan Marco Steffan
              Reporter:
              tsondergaard tsondergaard
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: