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

xUnit plugin cannot parse XML output with exception from boost test 1.42

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: xunit-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.405
      xUnit plugin 1.16.2
      xUnit plugin 1.25
    • Similar Issues:
      Show 5 results

      Description

      xUnit plugin fails on parsing test result XML generated by Boost test 1.42 which contains Exception.

      The example of the file we have:

      <TestLog><TestSuite name="Master Test Suite">
      <TestSuite name="TGS_RESOURCE_DTMF_DETECTION">
      <TestCase name="RES_DTMF_DETECTION_1">
      <Message file="./res_test_dtmf_detection.cpp" line="15"><![CDATA[==== Start test using AudioCodesSimRcs ====]]></Message>
      <Info file="./test_sip.cpp" line="179"><Unable to render embedded object: File ([CDATA[check !m_acceptor passed]]></Info><Info file="./test_sip.cpp" line="180"><) not found.[CDATA[check !m_acceptorThread passed]]>
      </Info>
      <Info file="./test_sip.cpp" line="187"><![CDATA[check ! m_socket.is_open() passed]]></Info>
      <Exception file="unknown location" line="0"><![CDATA[memory access violation]]>
      <LastCheckpoint file=".\res_test_dtmf_detection.cpp" line="17"><![CDATA[]]></LastCheckpoint>
      </Exception>
      <Message file="./boost/test/impl/unit_test_log.ipp" line="161"><![CDATA[Test is aborted]]></Message>
      <TestingTime>2313000</TestingTime>
      </TestCase>
      </TestSuite></TestSuite></TestLog>

      The output:

      [xUnit] [INFO] - Starting to record.
      [xUnit] [INFO] - Processing BoostTest-1.37.0 (default)
      [xUnit] [INFO] - [BoostTest-1.37.0 (default)] - 36 test report file(s) were found with the pattern '**\TestResult*.xml' relative to 'C:\jenkins\jobs\SMC-Build\workspace' for the testing framework 'BoostTest-1.37.0 (default)'.
      [xUnit] [ERROR] - The result file 'C:\jenkins\jobs\SMC-Build\workspace\release\TestResult\TGS_RESOURCE_DTMF_DETECTION-RES_DTMF_DETECTION_1.xml' for the metric 'BoostTest-1.37.0 (default)' is not valid. The result file has been skipped.
      [xUnit] [INFO] - Stopping recording.

      1. test.xml
        434 kB
        Martin Scherer

        Activity

        antonius Anton Nikitin created issue -
        Hide
        rioch rioch added a comment - - edited

        I'm getting a similar problem. The produced XML looks a little like this:

        <TestLog>
        <TestSuite name="Master Test Suite">
        <TestSuite name="TestSample">
        <TestCase name="TestSampleClass">Clf nr samples before:
        53 Clf nr samples after: 630
        <Exception file="unknown location" line="0">
        <![CDATA[std::exception: Unable to open 'features_in.txt'.]]>
        </Exception>
        <TestingTime>15000</TestingTime>
        </TestCase>
        </TestSuite>
        </TestSuite>
        </TestLog>

        The error reported in the error log is:

        WARNING: [xUnit] - At line 3 of file:/D:/Develop/boost-test-TestSample.xml:cvc-complex-type.2.4.b: The content of element 'Exception' is not complete. One of '

        {LastCheckpoint}

        ' is expected.

        I'm using Boost 1.45 but the xUnit setting 'BoostTest-1.37.0 (default)'.

        Show
        rioch rioch added a comment - - edited I'm getting a similar problem. The produced XML looks a little like this: <TestLog> <TestSuite name="Master Test Suite"> <TestSuite name="TestSample"> <TestCase name="TestSampleClass">Clf nr samples before: 53 Clf nr samples after: 630 <Exception file="unknown location" line="0"> <![CDATA [std::exception: Unable to open 'features_in.txt'.] ]> </Exception> <TestingTime>15000</TestingTime> </TestCase> </TestSuite> </TestSuite> </TestLog> The error reported in the error log is: WARNING: [xUnit] - At line 3 of file:/D:/Develop/boost-test-TestSample.xml:cvc-complex-type.2.4.b: The content of element 'Exception' is not complete. One of ' {LastCheckpoint} ' is expected. I'm using Boost 1.45 but the xUnit setting 'BoostTest-1.37.0 (default)'.
        Hide
        marscher Martin Scherer added a comment - - edited

        My log shows me that the attributes line and file are not allowed in an exception element.

        12.07.2011 18:12:48 com.thalesgroup.hudson.plugins.xunit.service.XUnitService errorSystemLogger
        SCHWERWIEGEND: [xUnit] - The result file 'test.xml' for the metric 'BoostTest-1.37.0 (default)' is not valid. The result file has been skipped.

        12.07.2011 18:12:48 com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger
        WARNUNG: [xUnit] - At line 1 of test.xml:cvc-complex-type.3.2.2: Attribute 'line' is not allowed to appear in element 'Exception'.

        12.07.2011 18:12:48 com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger
        WARNUNG: [xUnit] - At line 1 of test.xml:cvc-complex-type.3.2.2: Attribute 'file' is not allowed to appear in element 'Exception'.

        I'am using boost 1.44 with xUnit 1.18

        I hope this blocker will be fixed soon.

        Thank you,

        Martin Scherer

        Show
        marscher Martin Scherer added a comment - - edited My log shows me that the attributes line and file are not allowed in an exception element. 12.07.2011 18:12:48 com.thalesgroup.hudson.plugins.xunit.service.XUnitService errorSystemLogger SCHWERWIEGEND: [xUnit] - The result file 'test.xml' for the metric 'BoostTest-1.37.0 (default)' is not valid. The result file has been skipped. 12.07.2011 18:12:48 com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger WARNUNG: [xUnit] - At line 1 of test.xml:cvc-complex-type.3.2.2: Attribute 'line' is not allowed to appear in element 'Exception'. 12.07.2011 18:12:48 com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger WARNUNG: [xUnit] - At line 1 of test.xml:cvc-complex-type.3.2.2: Attribute 'file' is not allowed to appear in element 'Exception'. I'am using boost 1.44 with xUnit 1.18 I hope this blocker will be fixed soon. Thank you, Martin Scherer
        marscher Martin Scherer made changes -
        Field Original Value New Value
        Attachment test.xml [ 20608 ]
        gbois Gregory Boissinot made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        gbois Gregory Boissinot added a comment -

        I fixed it.
        Could you upgrade to xunit plug-in 1.19?
        The plugin can be download at http://maven.jenkins-ci.org/content/repositories/releases/com/thalesgroup/jenkins-ci/plugins/xunit/1.19/

        Show
        gbois Gregory Boissinot added a comment - I fixed it. Could you upgrade to xunit plug-in 1.19? The plugin can be download at http://maven.jenkins-ci.org/content/repositories/releases/com/thalesgroup/jenkins-ci/plugins/xunit/1.19/
        gbois Gregory Boissinot made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        marscher Martin Scherer added a comment -

        Hi gbois,

        I installed 1.19 manually and ran my tests again. Now it fails with this log messages:

        com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger
        WARNUNG: [xUnit] - At line 1 of file:test.log:cvc-complex-type.2.1: Element 'LastCheckpoint' must have no character or element information item [children], because the type's content type is empty.

        Snippet of test.log containing the Exception tag causing this:

         
        <TestSuite name="TrialSpaceTestSuite">
        <TestCase name="testLagrangeSpacesReferencePyramid">
        <Exception file="unknown location" line="0">
        <![CDATA[unknown type]]>
        <LastCheckpoint file="testDiscretization.cpp" line="74">
        <![CDATA[Checking shapes at dofs are kronecker delta ... ]]>
        </LastCheckpoint>
        </Exception>
        <TestingTime>0</TestingTime>
        </TestCase></TestSuite>
        

        As you might notice the filename and line attribute are nonsense because the exception occured in a lua script called from c. Nevertheless the attributes are generated by boost and should be parsed (or ignored - in a non fatal way).

        Greetings,
        Martin

        Show
        marscher Martin Scherer added a comment - Hi gbois, I installed 1.19 manually and ran my tests again. Now it fails with this log messages: com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger WARNUNG: [xUnit] - At line 1 of file:test.log:cvc-complex-type.2.1: Element 'LastCheckpoint' must have no character or element information item [children] , because the type's content type is empty. Snippet of test.log containing the Exception tag causing this: <TestSuite name= "TrialSpaceTestSuite" > <TestCase name= "testLagrangeSpacesReferencePyramid" > <Exception file= "unknown location" line= "0" > <![CDATA[unknown type]]> <LastCheckpoint file= "testDiscretization.cpp" line= "74" > <![CDATA[Checking shapes at dofs are kronecker delta ... ]]> </LastCheckpoint> </Exception> <TestingTime> 0 </TestingTime> </TestCase> </TestSuite> As you might notice the filename and line attribute are nonsense because the exception occured in a lua script called from c. Nevertheless the attributes are generated by boost and should be parsed (or ignored - in a non fatal way). Greetings, Martin
        Hide
        marscher Martin Scherer added a comment -

        test xml is not parsed completly.

        Show
        marscher Martin Scherer added a comment - test xml is not parsed completly.
        marscher Martin Scherer made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        marscher Martin Scherer added a comment -

        exception parsing bug is still present in version 1.25

        Show
        marscher Martin Scherer added a comment - exception parsing bug is still present in version 1.25
        marscher Martin Scherer made changes -
        Environment Jenkins 1.405
        xUnit plugin 1.16.2
        Jenkins 1.405
        xUnit plugin 1.16.2
        xUnit plugin 1.25
        Priority Major [ 3 ] Blocker [ 1 ]
        Hide
        gbois Gregory Boissinot added a comment -

        Fixed it.
        Please upgrade to xUnit 1.26

        Show
        gbois Gregory Boissinot added a comment - Fixed it. Please upgrade to xUnit 1.26
        gbois Gregory Boissinot made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        marscher Martin Scherer added a comment -

        Thanks alot!
        Greetings, Martin

        Show
        marscher Martin Scherer added a comment - Thanks alot! Greetings, Martin

          People

          • Assignee:
            gbois Gregory Boissinot
            Reporter:
            antonius Anton Nikitin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: