Generic test Data not parsing the xml file

SonarQube Version: Unknow. The web UI will not provide that information.
Build-wrapper-version: 6.20.5

I am trying to get the SonarQube scanner to parse a Generic Test Data formatted file. I am getting the following error. Error during parsing of generic test execution report ‘path to file’. Look at the SonarQube documentation to know the expected XML format.

I am using the following property: sonar.testExecutionReportPaths and sonar.coverageReportPaths. The coverage reports are processed without issues.

This is the example from the help section located on the SonarQube help pages. Note: This generates the same error.

<testExecutions version="1">
  <file path="testx/ClassOneTest.xoo">
    <testCase name="test1" duration="5"/>
    <testCase name="test2" duration="500">
      <skipped message="short message">other</skipped>
    <testCase name="test3" duration="100">
      <failure message="short">stacktrace</failure>
    <testCase name="test4" duration="500">
      <error message="short">stacktrace</error>

This is an example from my test data.

<?xml version="1.0" encoding="UTF-8"?>
<testExecutions version="1">
  <file path="SupportSystem/c-lib/Battery/src/test/cpp/BatteryMsgTest.cpp">
    <testCase name="SerialMessageTestSuite" duration="0"/>
    <testCase name="BatteryResetMessageTest" duration="0"/>
    <testCase name="BatteryResetDecodeWarningTest" duration="0"/>
    <testCase name="BatteryVersionConstructTest" duration="0"/>
    <testCase name="BatteryVersionDecodeTest" duration="0"/>
    <testCase name="BatteryVersionThrowChecksumTest" duration="0"/>
    <testCase name="BatteryVersionThrowDecodeExceptionTest" duration="0"/>
    <testCase name="BatteryVersionThrowDataByteDecodeExceptionTest" duration="0"/>
    <testCase name="BatteryVersionSmallBufferTest" duration="0">
      <failure message="short">stacktrace</failure>

I have tried the trivial case of one success. I have added and removed the <?xml version="1.0" encoding="UTF-8"?> tag. I have loaded the XML in an XML editor to check for syntax errors. I have read through several of the older posts with similar issues. This looks like it may be an ongoing problem for generic test data.

I have also tried playing with the property’s settings without resolution.

It does, in the footer of your instance. Can you check?

  • Enterprise Edition
  • Version 8.9.9 (build 56886)

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

8.9.10 → 9.9.4 → 10.4 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

I see you wish for me to single handily move the earth’s orbit. I work for a huge company and I dough they will change it.

By no means do I want to be unsympathetic! But if there’s a bug in the import of execution of test data that has been fixed in the 3 years since SonarQube v8.9 LTS was released… well, it’s not going to get fixed in an EOL version of SonarQube (that’s also not getting security patches :face_with_peeking_eye:).

With that being said, I faced no issue on SonarQube v8.9 LTS or v10.4 passing your sample test report into analysis.

INFO: Imported test execution data for 0 files
INFO: Test execution data ignored for 1 unknown files, including:
INFO: Sensor Generic Test Executions Report (done) | time=3ms

I wonder if there’s a stray encoding character that’s causing an issue that’s not manifesting when I copy paste your example?

We will discuss the upgrade issue with a member of the team responsible for maintaining those systems this afternoon. I would be shocked if we did not already have access to the upgrade path.

I will try copy pasting it from my own post and try that. This has been driving me up a wall.