Unable to provide sonarqube test coverage for go

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube=9.3, g0 = 1.17.7)
  • what are you trying to achieve -
    we are trying to scan tests in golang code. We have automated template to add sonar scanning. It’s not getting the go tests getting scanned.
  • what have you tried so far to achieve this
    After adding sonar-project.properties with line stating sonar.go.coverage.reportPaths=/coverage.out, we are still not able to get complete coverage for sonar scan.

I would like to know how sonar scanning worked for other go user and what can be added in order to get it scanned


Welcome to the community!

Is coverage.out located in the directory analysis starts from? Because the path you’ve provided indicates it’s located in the server root. Can you try removing that initial /?