SonarQube not counting unit tests

Hello,

Currently my team is using SonarQube developer edition version 9.3.

In Analysis Scope we added test file inclusion (sonar.test.inclusions). We have also added XML coverage report (sonar.python.coverage.reportPaths). The code and the tests are written in python. In Overall Code tab the coverage of our code looks good except the number of Unit Test is presented as ‘-‘ (screenshot attached). Should we do anything else to get the number of tests displayed correctly?

unit-tests

best regards

Hey there.

Specifying sonar.tests or code coverage is not enough – you’ll also need to pass in test execution reports (for python, sonar.python.xunit.reportPath)

3 Likes

Hello,

I have specified sonar.python.xunit.reportPath as you suggested. I also had to set sonar.python.xunit.skipDetails=true and it worked (screenshot attached).
sonar

Thank you for your help Colin !

2 Likes

Hi @Colin ,

Unit test success density is not capturing in the dashboard for python. What could be the problem, can you advise here, thanks.

Hey @MANIKANDAN_RAMU

Instead of reviving an old thread, please create a new thread and give all the details (SonarQube version, analysis parameters used, CI configuration, what the logs say…)

I will close this thread…