New Code Coverage always 0

Must-share information (formatted with Markdown):

  • I have SonarQube 8.3.1, Scanner 4.3.0, Plugin Swift 4.2.2
  • I would like to get non-zero Coverage on New Code.
  • I ran the scanner / analyzer and get 0 % Coverage on New Code (after having fixing some bugs).

Hi @thinh,

Do you have non-zero coverage on Overall Code? Just to ensure you got some coverage at all.
If no, I assume you have a basic issue with your coverage.

Hi @Daniel.Schiffer,

We have written Unit Tests extensively, but Sonar Scanner does not see them. I don’t know why our codes are seen as 0% Overall Code coverage. Is it because we have to use the same naming convention, say, methodABC() and its test testMethodABC() ?

Hi @thinh,

Welcome to the community!

Are you actually importing a coverage report?


Hi @ganncamp,

The coverage-swift.htm under the directory sonar-reports is empty.

<?xml version='1.0' ?>

Let me try to run the command in your link “importing a coverage report”.