Converter for generic test format

Hi All,

I am trying to push unit test report to sonarqube but it seems the test report xml isnt supported by sonar. I am using Sonarqube version 7.7 . It seems like i need to convert my TEST report to the format supported as mentioned in the below link

https://docs.sonarqube.org/latest/analysis/generic-test/

Do you have any converter to meet my requirement. Any help would be highly apreciated

Regards,
Rahul Khandelwal

Hi. What do you mean by…

Which test report? What is your testing library? What is the programming language?

The programming language is Swift. the Test-report.xml which is getting generated is of the below format

<?xml version='1.0' encoding='UTF-8'?>

but my sonarqube analysis fails with the below error
ERROR: Caused by: Unknown XML node, expected “testExecutions” but got “testsuites” at line 2

seems like i need to convert my test-report.xml file to the below format. is that possible

<?xml version="1.0" encoding="UTF-8"?>
<testExecutions version="1">
  <file path="<long path>/__tests__/api.test.js">
    <testCase name="Feature when called with proper params then does somthing" duration="5"/>
    <testCase name="Feature when called with wrong paramg then does nothing" duration="1"/>
  </file>
</testExecutions>

Hi,

It sounds like your parameter configurations are messed up. The file snipped you’re showing doesn’t contain “testSuites”.

 
Ann

hi. I am running Powershell unit tests with Pester. Do you know if the generic coverage is already supported by Pester? Or else, do you know if a converter exists?

Hi @sebastianslutzky,

Welcome to the community!

Sorry, no idea.

 
Ann

thanks Ann.
Pester seems to produce only JaCoCo output format, so we will try using that instead of generic format.

1 Like

@Rahul_Khandelwal I am facing same issue for my nodeJs application. Did you get the solution for this issue?

Thanks
Mayank