A question about generic test execution

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 7.6

  • what are you trying to achieve
    Integrate GoogleTest result into sonarqube and the unit test cases can be drilled down.
    For example, when some unit test failed, developers can easily find which one.

  • what have you tried so far to achieve this
    I followed the schema of generic test execution, converted the XML report of google test and update sonar properties (add sonar.testExecutionReportPaths=uts_report.xml). Inside of the XML, I prepared some failure cases with some messages.

Sonar-scanner ran successfully but when I looked into the analysis. Sonarqube only shows the count of failure cases, without any details.

Where to find the details of the failure?

Attached the screenshot and the uts_report.xml.

2019-02-16_16-26-06

Thanks very much!

Add the uts_report.xml

uts_report.xml

Nowhere. SonarSource dropped the UI that used to show the test details. In SonarQube 7.6 you won’t be able to see that information anywhere.

1 Like

Thanks for the reply, @Scott.
Do you know which version of Sonarqube supports this function? And is it possible to write some plugins to let Sonarqube show this info?

The last version that supported it was SonarQube 7.4. We could open the test file, go to “Show measures” and see the test details:

image

I don’t think it’s possible to write a plugin to show this info. This doesn’t exist in SonarQube 7.5 and newer.

1 Like

Many thanks, @Scott.
I will have a try on SonarQube 7.4.

And I personally don’t understand why SonarSource dropped such important feature. Every engineer wants to know where the failure/error is.

Hi @Scott,

Thanks for your information. I’ve implemented kind of converter to generate the generic test report and it works well.

Hi @yqli1983. Could you please share the converter as I am stuck with the same problem

No problem. Let me do some clean up first. Super busy recently.

@yqli1983 Thanks … is it possible to send across the converter in next couple of days. Much appreciated

Should be ready by weekend.

Kool . Thanks a lot mate

Hi @yqli1983. Any update on the translator

Check this github link.

In the google test report, there is no information about where the test comes from. So to link them, you need to provide the source files of test cases.

I only did some testings with sample projects. Not yet use it in any real production. You can file me issue on github. :grinning: