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?
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?
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.
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.
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.