show unit test success/failure count in sonarqube

4.5k views Asked by At

I'm using an asp.net MVC project with VSTS and Sonar (5.6.3). My unit test coverage is showing up on my Sonar Dashboard.

However, I didn't find a way to display number of unit test passed/failed on the dashboard.

Any help?

enter image description here

2

There are 2 answers

3
G. Ann - SonarSource Team On

You won't find any way to display those measures on the pre-configured project home page. However, if you have fed Unit Test Execution data, they will be available on the Measures, page, and on the Coverage sub-page.

To be explicit, this data cannot be "intuited" from your test coverage reports, but must be provided separately.

0
Yu Patrick On

I am not sure my issue is relate to yours. I am using karma-sonarqube-unit-reporter to generate output.xml for sonar. The reason number of unit tests doesnt show on home page is in the output.xml all the file paths are not defined. Change all the file paths to test files paths solve the problem. Hope this helps.