Generic test results: folder/files not found

Hi team,
based on the guidance here, I’ve placed a file named “result.xml” into a directory “report”. The file contains the xml content from your how-to. The sonar execution properties does contain the key/value: sonar.testExecutionReportPaths=report. Starting the Sonar scanner, it is running pretty well, however at the end it fails with
"ERROR Error during parsing of generic test execution report (correct absolute path to the directory named report). Look at the SonarQube documentation to know the expected XML format.
ERROR caused by: (correct absolute path to the report file) (Is a directory)

I assumed the scanner expects a directory and processes all files inside that folder?
What is configured wrong please preventing the generic data picked up correctly?

Thank you.

Hi,

As described in the docs, that parameter is expecting a comma-delimited list of paths to files. So just append result.xml and you should be good.

 
Ann

Hi Ann.

Thank you.

The docs only state that a list of paths must be insert, similar to the doc I’ve mentioned above. For me, a path is a directory, not the path+filename. Thus, in case I have 60 files, I need to add a list of comma-delimited 60 filenames? Is the name result.xml mandatory? Looks like this is not mentioned in the docs.

I’ve also added sonar.tests=report/result.xml to the scanner properties, and the processing was now successful.

The result, in SonarQube, is shown under Measures->Coverage->Tests->Unit tests. Is there any other perhaps more prominent place where the results are or can be visualized, please?

I have test result files aligned with Unit test xml format, e.g. it has testsuite elements. Although you integrate generic test results as unit tests, your generic XML format is proprietary. What is your recommendation how to re-format my files? I’m wondering, is there any XSLT available for that?

Thank you for your help. :slight_smile:

Best regars
Michael

Hi Michael,

You have 60 files in the Generic Execution Data format side, by side in one directory?

Uhm… that property is supposed to point to test files. Files that contain the tests themselves. Not to reports.

We try to keep it to one question per thread. Otherwise it gets messy fast, as I feel is happening here. Please create a new thread for this question.

 
Ann

Hi Ann.
I’m using sonar.tests=report/result.xml to the scanner properties, because if I do not do that, I get an error:
ERROR: Error during SonarScanner execution
ERROR: Error during parsing of generic test execution report …
ERROR: Caused by: Line 2 of report refers to a file which is not configured as a test file: report/result.xml

What is the recent recommended way to import generic test data to SonarQube? The documentation also lacks information where I can find the data once they are imported.

Sorry, the XML / XSLT question was actually just feedback, since I suppose if you manage generic test data like unit tests, you could probably support the standard unit test report format.

Thanks.

Michael

Hi Michael,

Why would your generic test execution report reference the report itself?

You’ll see the data in the Measures page.

 
Ann

Hi Ann.
It is just an example. As explained a bit earlier, your generic integration right now requires that the report must reference concrete test files. Thus, to make it easy, and for testing purposes, I have referenced the xml report file itself. It may help if you add more information to the documentation?
The data under Measures are always and only under Measures->Coverage->Tests->Unit tests right?
Thank you.

Michael

Hi Michael,

Let’s back up.

You’re analyzing a test file that doesn’t have real data in it?

 
Ann

Hi Ann.
I stream in a test report what is described here as generic execution, see above.

Michael

Hi Michael,

I’ve just re-read your OP

You do understand that for this to work you need to fill in actual values for actual files in your project…?

 
Ann

Hi Ann.
Sure. I’d like to suggest that you incorporate my feedback to the official documentation.

Michael

Hi Michael,

Sorry to be dense, but it’s not clear to me what you think should be added to the docs.

 
Ann

Hi Ann.
Thanks for taking care. I cannot answer what you may want to add to the documentation. The questions above may suggest that there are little pieces in the documentation that may need further polishing.

Michael