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

Special characters in test failure message causes xUnit to ignore the xml file as invalid.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.349 on Windows 2003 Server
    • Similar Issues:

      Description

      We are using CppUnit for testing the code and xUnit plugin has been working great to capture and report the results...

      However, our Unittest just recently failed with a failure message that causes xUnit to ignore it as "invalid" and it seems as though the test hasn't run.

      CppUnit outputs an XML file and in the <Message> section, if the content of the failure message contains either "&&" or "<" it causes the XML file to be considered invalid. There are probably other character strings that will cause this invalid issue, but these are the ones I had in my test.

      Is there a way to escape these special characters? I tried putting it in quotes or using a backslash...neither worked.

        Attachments

          Activity

          Hide
          jmboulos jmboulos added a comment - - edited

          I have looked into it further and I am mistaken – it is not the problem of Hudson or xUnit.

          & < > ' " are all special characters not allowed in XML files so xUnit saw the XML file as invalid (as it should).

          I can't tell the developers never to use those characters in their CppUnit messages, so I am handling it on my side. I do post processing in Hudson to just change the characters to their appropriate version for the XML file (& < > etc).

          You can close it, or withdraw the issue.

          Show
          jmboulos jmboulos added a comment - - edited I have looked into it further and I am mistaken – it is not the problem of Hudson or xUnit. & < > ' " are all special characters not allowed in XML files so xUnit saw the XML file as invalid (as it should). I can't tell the developers never to use those characters in their CppUnit messages, so I am handling it on my side. I do post processing in Hudson to just change the characters to their appropriate version for the XML file (& < > etc). You can close it, or withdraw the issue.

            People

            Assignee:
            gbois Gregory Boissinot
            Reporter:
            jmboulos jmboulos
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: