uartois / sonar-golang

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

Coverage metrics not being imported, using latest jar v1.2.11-rc8 #53

Closed BharadwajKk closed 6 years ago

BharadwajKk commented 6 years ago

Description

I am using the latest sonar-golang jar v1.2.11-rc8 but still I'm unable to get the Coverage metrics on the Sonar Dashboard.

Steps to Reproduce

I'm running SonarQube server 6.7.1 locally and I have added the latest sonar-golang jar(sonar-golang-plugin-1.2.11-rc8.jar) to it's plugins. Using latest versions for go, gometalinter.v1, etc. Running SonarQube Scanner 3.0.3.778 to scan.Also, the coverage.xml file gets created properly, but it's not imported to the Sonar dashboard for some reason.

Content of your sonar-project.properties

sonar.projectKey=deid sonar.projectName=deid sonar.projectVersion=1.0 sonar.golint.reportPath=report.xml sonar.coverage.reportPath=coverage.xml sonar.coverage.dtdVerification=false sonar.test.reportPath=test.xml sonar.sources=./

Log of sonar-scanner related to the plugin

sonar-scanner -X Logs: https://gist.github.com/BharadwajKk/d31e583759adc1b666c017aefcf99d2e

Versions

go version go1.9.2 linux/amd SonarQube server 6.7.1 SonarQube Scanner 3.0.3.778 Java 1.8.0_121 Oracle Corporation (64-bit) Linux 3.10.0-327.el7.x86_64 amd64

Additional Information

coverage.xml, report.xml: https://gist.github.com/BharadwajKk/b90e16d8fa7e1d1cc90c2e55e1d944c6

danielleberre commented 6 years ago

@BharadwajKk hum, your file is not even considered by the coverage sensor.

@thibaultfalque I think that the problem lies in the way the exclusion path is handled in CoverageSensor, especially that test: !p.getParent().toString().contains(".git") which would prevent AFAI understand any file from a git clone to be considered.

Could you check?

thibaultfalque commented 6 years ago

Normally this line prevent exploring hidden files and git configuration files. I will check.

BharadwajKk commented 6 years ago

Also, I forgot to mention that it does shows the code smells on the dashboard, which means that the report.xml file is being imported. But dont know why the coverage.xml and test.xml files are not.

thibaultfalque commented 6 years ago

Hi @BharadwajKk, I will publish today a new release with a fix for your problem.

thibaultfalque commented 6 years ago

Hi @BharadwajKk I have publish a new release please test: https://github.com/uartois/sonar-golang/releases/tag/1.2.11-rc-reubentfix

BharadwajKk commented 6 years ago

Hi @thibaultfalque, the new release is working. Coverage metrics is now available on the dashboard. Thanks a lot for your help. @danielleberre @thibaultfalque :+1:

thibaultfalque commented 6 years ago

You're welcome @BharadwajKk :) Can you close this issue ?

BharadwajKk commented 6 years ago

Yeah sure.