-
Notifications
You must be signed in to change notification settings - Fork 34
Capture coverage failing when using docker #35
Description
Description
When attempting to publish coverage.xml
, report.xml
, and test.xml
to SonarQube after generating the individual xml files, I'm seeing the following happen.
- The coverage is not honoring the
sonar.exclusions
entry, as all the files in my.glide/**
andvendor/**
are being processed. unable to create InputFile object: gitscm.cisco.com/ccdev/cicdtest/version/info.go
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Steps to Reproduce
- Build Dockerfile for running SonarQube locally
FROM sonarqube:6.5-alpine
RUN wget -O "$SONARQUBE_HOME/extensions/plugins/sonar-golang-plugin-1.2.11-rc3.jar" \
https://github.com/uartois/sonar-golang/releases/download/v1.2.11-rc3/sonar-golang-plugin-1.2.11-rc3.jar
docker build -t cicdtest_sonar -f Dockerfile.cd .
- Start SonarQube
docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 cicdtest_sonar
- Run sonar-scanner
sonar-scanner -X \
-Dsonar.host.url=http://localhost:9000 \
-Dsonar.login=534221ba8db9121b9afe15a322a5fa1f17d3c9df
Content of your sonar-project.properties
It will help us to check how you configured the plugin.
Log of sonar-scanner related to the plugin
https://gist.github.com/kenjones-cisco/8b5f55f4f5197d3ddfba66142aeefbc1#file-scanner-log
The plugin logs major events, including which report files have been found and analyzed.
Versions
SonarQube Server
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin",
"LANG=C.UTF-8",
"JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk",
"JAVA_VERSION=8u131",
"JAVA_ALPINE_VERSION=8.131.11-r2",
"SONAR_VERSION=6.5",
"SONARQUBE_HOME=/opt/sonarqube",
"SONARQUBE_JDBC_USERNAME=sonar",
"SONARQUBE_JDBC_PASSWORD=sonar",
"SONARQUBE_JDBC_URL="
],
sonar-scanner
INFO: Scanner configuration file: C:\Users\kenjones\.local\bin\sonar-scanner-3.0.3.778\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\Users\kenjones\projects\examples\cicdtest\sonar-project.properties
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_131 Oracle Corporation (64-bit)
INFO: Windows 10 10.0 amd64
go version
go version go1.9 linux/amd64
gometalinter
c039b9f1fbff9a38595e19e9d97474ed57270cb8
Last commit as of yesterday
OS
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
All go
, gometalinter
, etc. are run inside of Docker containers
Versions of your sonar installation (server, sonar-scanner), gometalinter, go and OS.
Additional Information
All *.xml are in the same gist as the other files:
https://gist.github.com/kenjones-cisco/8b5f55f4f5197d3ddfba66142aeefbc1
Seems similar to #14
Sample reports may be necessary to reproduce the issue. Please attach if possible reports files (report.xml, coverage.xml, test.xml) corresponding to the feature which is not working as expected.