1

I don't know much about Sonar Qube. This is regarding test automation reports using SonarQube. Basically we have Code Coverage and Quality gate reports for different languages in Sonar. But can be have a simple looking Pass/Fail report integrated into it also with input being an xml? We have a common dashboard of SonarQube for Coverage, Quality Code Gates etc and wanted to have the same for using as a test reporting dashboard. Currently we are using a UI Automation tool 'Froglogic Squish'(with Python scripting) for test automation which gives reports in html and also a well formatted xml is produced for the same.

My question is firstly, is it possible for Junit-format xmls pass/fail reports to appear on SonarQube, if yes, secondly we can transpose our Squish report xml to a Junit-format xml and can that be used directly by some plugin in Sonar Qube to show reports in the dashboard.

(Please find below the console output from Jenkins when i run Sonar with Sonar Java for Junit reports)

INFO: Sensor XmlFileSensor
INFO: 1 source files to be analyzed
INFO: Sensor XmlFileSensor (done) | time=154ms
INFO: Sensor Zero Coverage Sensor
INFO: 1/1 source files have been analyzed
INFO: Sensor Zero Coverage Sensor (done) | time=134ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=50ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 5475ms, dir size=54 MB
INFO: Analysis reports compressed in 7911ms, zip size=39 MB
INFO: Analysis report uploaded in 6604ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/SonarJunit
G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
Saumya
  • 82
  • 3
  • 10

1 Answers1

0

If you can get your data into a a JUnit format then you should be able to pull this data in to SonarQube. Take a look at the docs for what properties to set.

To see this data, you'll use the Measures page.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Thanks for your reponse, I didnt understand how we'd be able to use this exactly? We only have an xml report , which we will transpose into an Junit-Format report. The Usage in the docs says we need surefire-reports. – Saumya Mar 23 '17 at 07:45
  • ...I think it's the same thing..? – G. Ann - SonarSource Team Mar 23 '17 at 07:55
  • Thanks Ann, we executed this using Jenkins with Sonar plugin, with Sonar properties : sonar.junit.reportsPath = **/reports/*.xml, (also tried with just the path */reports/), We get the console output as mentioned in the next comment. But the sonarQube output in the measures tab , we don't see anything related to Junit results. Please help. – Saumya Mar 24 '17 at 06:23
  • I have added the jenkins console output to the question as could not copy it here in the comment. – Saumya Mar 24 '17 at 06:30