sonar-golang
sonar-golang copied to clipboard
Sonar Scanner is failing saying XML file is not correctly formatted for golang plugin and not displaying results in sonarqube
Description
I am getting below error
NFO: Analyse for /home/dca-cm/coverage.xml [Fatal Error] coverage-04.dtd:1:3: The markup declarations contained or pointed to by the document type declaration must be well-formed. ERROR: Exception: org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.
I have verified coverage.xml in https://www.xmlvalidation.com and found no issue
sonar-golang-plugin-1.2.11----------> Golang plugin sonarqube-6.3.1-----------------------> Sonarqube server
error-golang.txt Here is the log of sonar scanner
Hi,
It's very strange what is this file coverage.docx ? It is not the coverage report ? There are HTML and Go code.
Could you share the report generate by gocov test ./... | gocov-xml > coverage.xml ?
See this part of readme for more details.
reports.zip I had shared the coverage.xml and test .xml Surprising if i delete below lines the above error got vanished
this is my sonar-project.properties file
sonar.projectKey=xxxx sonar.projectName=xxxx sonar.projectVersion=1.0
GoLint report path, default value is report.xml
sonar.golint.reportPath=report.xml
Cobertura like coverage report path, default value is coverage.xml
sonar.coverage.reportPath=coverage.xml
if you want disabled the DTD verification for a proxy problem for example, true by default
sonar.coverage.dtdVerification=false
JUnit like test report, default value is test.xml
sonar.test.reportPath=test.xml sonar.sources=./ sonar.tests=./ sonar.test.inclusions=/_test.go sonar.sources.inclusions=/.go sonar.highlighting=false sonar.showProfiling=true sonar.log.level=DEBUG sonar.exclusions=vendor/,proto/,proto_python/,.git/, **/test.go, **/.xml, /*.py, testutils/, **/*.js
I can't see any errors in my log but neither coverage report nor unit test case reports getting displayed
Hello @Subhajit-Dutta, Could you try disabling the DTD check?