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

CTest JUnit XML file is not being read properly - GoogleTest units

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • xunit-plugin
    • None
    • Jenkins version 2.452.1 xUnit plugin version 3.1.4 CMake version 3.29 googletest version 1.14

      While using CTest (with googletests registered to it) to output JUnit xml files for xUnit plugin, I found that despite the xml files being populated, xUnit thought there were no tests (when reading with the CTest tool):

      xunit (
                  tools: [CTest(
                  pattern: '**/ctestReport.xml',
                  deleteOutputFiles: true,
                  failIfNotNew: false,
                  skipNoTestFiles: true,
                  stopProcessingIfError: true
                  )]
              )

      However when I used the same xml file but changed the tool to GoogleTest, the tests were picked up correctly. This implies that either CTest is outputting the files incorrectly, or xUnit is expecting them incorrectly.
      I have already opened a stack overflow question for this, which explains the issue better: https://stackoverflow.com/questions/78618152/why-does-ctest-output-a-junit-xml-in-googletest-format-or-why-does-jenkins-plugi

            nfalco Nikolas Falco
            markbmda Mark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: