uartois / sonar-golang

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

Not able to find lookup_unix.go using wierd gopath/goroot #69

Open pontusarfwedson opened 6 years ago

pontusarfwedson commented 6 years ago

Description

When running sonar-scanner within the docker container specified by the Dockerfile specified in https://github.com/cathive/concourse-sonarqube-resource and have coverage, test and report from the tools described here we get: ERROR: Not able to find an InputFile from ./../../../../usr/local/go/src/net/lookup_unix.go This is being run as a resource in the CI system Concourse but basically the script out in the dir assets is what is being run inside the container.

Steps to Reproduce

Can be difficult to reproduce the exact way we do (since we run it as a resource to Concourse) but might be possible to just run the docker image, exec into it and start the sonar scanner.

Content of your sonar-project.properties

sonar.projectKey= sonar.projectName= sonar.sources=. sonar.inclusions=/.go

Log of sonar-scanner related to the plugin

The plugin logs major events, including which report files have been found and analyzed. Errors we encounter + some warning output and standard output:

ERROR: Highlighting problem on save
ERROR: Highlighting problem on save
ERROR: Highlighting problem on save
ERROR: Highlighting problem on save
ERROR: Highlighting problem on save
ERROR: Highlighting problem on save
ERROR: Highlighting problem on save
ERROR: Not able to find an InputFile from ./../../../../usr/local/go/src/net/lookup_unix.go
ERROR: Not able to find an InputFile from ./../../../../usr/local/go/src/net/lookup_unix.go
ERROR: Not able to find an InputFile from ./../../../../usr/local/go/src/net/lookup_unix.go
.
.
.
ERROR: Not able to find an InputFile from ./../../../../usr/local/go/src/net/lookup_unix.go
ERROR: Not able to find an InputFile from ./../../../../usr/local/go/src/net/lookup_unix.go

Versions

Server is running Sonarqube docker image 6.7.2 and sonar-scanner 3.1.0.1141 and plugin version 1.2.11.

Additional Information

The reason might not be anything else than that we need to have golang installed in our environment when we run sonar-scanner with the go plugin but I cannot seem to find any information regarding that. Do we?

danielleberre commented 6 years ago

hum, it looks similar to #35.

Could you try the workaround described in that issue?

pontusarfwedson commented 6 years ago

Yeah, that is in fact working. I realised now that gocov-xml doesn't seem to be very well maintained (nothing has happened the last 5 years). Might there be a better option out there?

danielleberre commented 6 years ago

There should be a new upcoming version of gocov-xml.

The fix needs to be updated to the latest version on master: https://github.com/AlekSi/gocov-xml/pull/4#issuecomment-385237188

thibaultfalque commented 5 years ago

@pontusarfwedson have you tried the solution suggested by @danielleberre ?