1、xml files are generated in the WORKSPACE directory. As follows:
      cppcheck --enable=all --inconclusive --xml --xml-version=2  "${file_name}" 2>"${WORKSPACE}/cppcheck-result.xml"

      2、Call the publishCppcheck plug-in to get the data. As follows:
      stage("Push_cppcheck_result") {
          steps {
              updateGitlabCommitStatus name: 'Jenkins', state: 'running'
              publishCppcheck pattern: "cppcheck-result.xml"
          }
       
      3、Running result

      4、No result file is generated on the primary server

          [JENKINS-71767] publishCppcheck do not work in the pipeline

          xiangfei created issue -

          xiangfei added a comment -

          xiangfei added a comment - Jenkins version:2.401.1 Cppcheck Plug-in version:1.26 { }
          xiangfei made changes -
          Assignee Original: Marco Steffan [ marcosteffan ] New: xiangfei [ lili ]
          xiangfei made changes -
          Assignee Original: xiangfei [ lili ]
          xiangfei made changes -
          Description Original: 1、xml files are generated in the WORKSPACE directory. As follows:
          {color:#00875a}cppcheck --enable=all --inconclusive --xml --xml-version=2  "${file_name}" 2>"${WORKSPACE}/cppcheck-result.xml"{color}
          {color:#00875a}!image-2023-08-04-17-30-34-804.png!{color}
          2、Call the publishCppcheck plug-in to get the data. As follows:
          {color:#00875a}stage("Push_cppcheck_result") {{color}
          {color:#00875a}    steps {{color}
          {color:#00875a}        updateGitlabCommitStatus name: 'Jenkins', state: 'running'{color}
          {color:#00875a}        publishCppcheck pattern: "cppcheck-result.xml"{color}
          {color:#00875a}    }{color}
          {color:#00875a}}{color}
           
          3、Running result
          !image-2023-08-04-17-30-10-254.png!
          4、No result file is generated on the primary server
          !image-2023-08-04-17-31-26-107.png!
          New: 1、xml files are generated in the WORKSPACE directory. As follows:
          {color:#00875a}cppcheck --enable=all --inconclusive --xml --xml-version=2  "${file_name}" 2>"${WORKSPACE}/cppcheck-result.xml"{color}
          {color:#00875a}!image-2023-08-04-17-30-34-804.png!{color}
          2、Call the publishCppcheck plug-in to get the data. As follows:
          {color:#00875a}stage("Push_cppcheck_result") {{color}
          {color:#00875a}    steps {{color}
          {color:#00875a}        updateGitlabCommitStatus name: 'Jenkins', state: 'running'{color}
          {color:#00875a}        publishCppcheck pattern: "cppcheck-result.xml"{color}
          {color:#00875a}    }{color}
           
          3、Running result
          !image-2023-08-04-17-30-10-254.png!
          4、No result file is generated on the primary server
          !image-2023-08-04-17-31-26-107.png!

          Chris added a comment -

          Jenkins version: 2.426.1

          Cppcheck Plug-in version: 1.26

           

          I also am seeing this bug intermittently. When creating the xml file via cppcheck command, the file gets created, but Jenkins will intermittenly fail when [Cppcheck] Starting the cppcheck analysis. Usually takes a minute or two before it fails at displaying the cppcheck results. 

          Chris added a comment - Jenkins version: 2.426.1 Cppcheck Plug-in version: 1.26   I also am seeing this bug intermittently. When creating the xml file via cppcheck command, the file gets created, but Jenkins will intermittenly fail when [Cppcheck] Starting the cppcheck analysis. Usually takes a minute or two before it fails at displaying the cppcheck results. 

            Unassigned Unassigned
            lili xiangfei
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: