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

XPathExeption when parsing QtTestLib Reports when a Test contains multiple Incidents

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • xunit-plugin
    • Jenkins V2.125
      xUnit plugin V2.0.0
      Windows Server 2008 R2 Standard, SP1
      QtTest 4.8.7

      I have an QtTest Report which has multiple incident of type fail within one TestFunction.
      The Exception is
      [xUnit] [ERROR] - Conversion error Error to convert the input XML document
      ERROR: Step ‘Publish xUnit test result report’ aborted due to exception:
      hudson.remoting.ProxyException: net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the first argument of concat()

      When the transformation handle the fail (ln 97) the variable "file" will contain an Array. This is not supported by the concat in ln 109.

      Attatched a Report which cause the error and a modified Transformation which will prevent the error.

          [JENKINS-51604] XPathExeption when parsing QtTestLib Reports when a Test contains multiple Incidents

          Nikolas Falco added a comment - - edited

          Reading the documentation here a QFAIL command stop the execution so how is possible that you have 3 incident of type fail?

          The XSL you attach cover the issue of concat function (where skip and fail was written relying on the fact that only one incident) but report wrong on failure count (3 failures on 4 tests).

          Please give more information on how yoy run these tests, if you use some logger transformation and so on.

          Nikolas Falco added a comment - - edited Reading the documentation here a QFAIL command stop the execution so how is possible that you have 3 incident of type fail? The XSL you attach cover the issue of concat function (where skip and fail was written relying on the fact that only one incident) but report wrong on failure count (3 failures on 4 tests). Please give more information on how yoy run these tests, if you use some logger transformation and so on.

          Nikolas Falco added a comment -

          I have clone a github repository with a lot of test executed with different version of QtTest >= 4.8 till 5.7

          With this PR I had try to conver use cases that could generate multiple Incident of type fail inside the same TestFunction (Travis log). No test case produce a report like report you attached.

          <?xml version="1.0" encoding="ISO-8859-1"?>
          <TestCase name="ThirdCase_test">
          <Environment>
              <QtVersion>4.8.7</QtVersion>
              <QTestVersion>4.8.7</QTestVersion>
          </Environment>
          <TestFunction name="initTestCase">
          <Incident type="pass" file="" line="0" />
          </TestFunction>
          <TestFunction name="consecutiveFailureStopOnFirst">
          <Incident type="fail" file="moc/../thirdCase.hh" line="12">
              <Description><![CDATA[failure 1]]></Description>
          </Incident>
          </TestFunction>
          <TestFunction name="failureOnCompareStopOnFirst">
          <Incident type="fail" file="moc/../thirdCase.hh" line="17">
              <Description><![CDATA[Compared values are not the same
             Actual (1): 1
             Expected (2): 2]]></Description>
          </Incident>
          </TestFunction>
          <TestFunction name="expectedFailure">
          <Incident type="xfail" file="moc/../thirdCase.hh" line="24">
              <Description><![CDATA[Will fix in the next release]]></Description>
          </Incident>
          <Incident type="pass" file="" line="0" />
          </TestFunction>
          <TestFunction name="cleanupTestCase">
          <Incident type="pass" file="" line="0" />
          </TestFunction>
          </TestCase>
          

          Nikolas Falco added a comment - I have clone a github repository with a lot of test executed with different version of QtTest >= 4.8 till 5.7 With this PR I had try to conver use cases that could generate multiple Incident of type fail inside the same TestFunction ( Travis log ). No test case produce a report like report you attached. <?xml version= "1.0" encoding= "ISO-8859-1" ?> <TestCase name= "ThirdCase_test" > <Environment> <QtVersion> 4.8.7 </QtVersion> <QTestVersion> 4.8.7 </QTestVersion> </Environment> <TestFunction name= "initTestCase" > <Incident type= "pass" file= "" line=" 0" /> </TestFunction> <TestFunction name= "consecutiveFailureStopOnFirst" > <Incident type= "fail" file= "moc/../thirdCase.hh" line= "12" > <Description> <![CDATA[failure 1]]> </Description> </Incident> </TestFunction> <TestFunction name= "failureOnCompareStopOnFirst" > <Incident type= "fail" file= "moc/../thirdCase.hh" line= "17" > <Description> <![CDATA[Compared values are not the same Actual (1): 1 Expected (2): 2]]> </Description> </Incident> </TestFunction> <TestFunction name= "expectedFailure" > <Incident type= "xfail" file= "moc/../thirdCase.hh" line= "24" > <Description> <![CDATA[Will fix in the next release]]> </Description> </Incident> <Incident type= "pass" file= "" line=" 0" /> </TestFunction> <TestFunction name= "cleanupTestCase" > <Incident type= "pass" file= "" line=" 0" /> </TestFunction> </TestCase>

          Michael Wietzke added a comment - - edited

          I've attatched a little project which will create the Report.
          A Report with multiple Incidents in one TestFunction is created when using data-driven tests. For each data row the test will create on incedent.

          In the project it's the function 'void MyQtTestTestProjectTest::sort_test()' which is testing created with 'void MyQtTestTestProjectTest::sort_test_data()'.

          Michael Wietzke added a comment - - edited I've attatched a little project which will create the Report. A Report with multiple Incidents in one TestFunction is created when using data-driven tests. For each data row the test will create on incedent. In the project it's the function ' void MyQtTestTestProjectTest :: sort_test () ' which is testing created with 'void MyQtTestTestProjectTest ::sort_test_data()'.

          kpop added a comment -

          +1

          kpop added a comment - +1

            nfalco Nikolas Falco
            br_michael Michael Wietzke
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: