uartois / sonar-golang

Sonarqube plugin for the golang language.
GNU Lesser General Public License v3.0
245 stars 32 forks source link

Coverage : only the last class is displayed in SonarQube #10

Closed AlexandreRzc closed 7 years ago

AlexandreRzc commented 7 years ago

Description

Only the last class/file of the generated report is displayed in the coverage section in SonarQube

Steps to Reproduce

  1. Generate a coverprofile file on folder with several go files
  2. Generate a coverage report with the command : gocov convert cover.out | gocov-xml > coverage.xml
  3. Launch Sonar Scanner
  4. Look at the coverage section in SonarQube : only the last file/class of the coverage.xml is displayed
  5. Edit the coverage report and remove the last file/class
  6. Look at the coverage section in SonarQube : the previous file/class of the deleted file/class is displayed instead
danielleberre commented 7 years ago

Thanks for pointing that out.

There is indeed an issue in the way we deal with the cover files. We need to feed sonar after each file in the report, not at the end of the report.

We will do our best to provide you a fix ASAP. Sorry for the inconvenience.

AlexandreRzc commented 7 years ago

It works now : bravo ! :)