SonarQube generic coverage sensor fails with with an unknown language for go

坚强是说给别人听的谎言 提交于 2019-12-12 04:23:24

问题


I am trying to have SonarQube (6.0) with generic test coverage plugin (1.2) read the coverage report which I created for go language. Coverage report is exactly in the xsd schema that sonar expects. However the analysis with sonar-scanner 2.8 fails with following exception.

java.lang.IllegalStateException: Line 2 of report test-results.xml refers to a file with an unknown language: queue/queue.go

I am passing following in sonar-project.proeprties.
    sonar.import_unknown_files=true
    sonar.genericcoverage.reportPaths=test-results.xml

Can you provide some suggestion on how to go about it.


回答1:


The basis of any analysis is the code analyzer which declares the language (Go, in this case). Typically analyzers also parse the language, provide metrics for it and offer some rules.

You cannot pull in coverage results for a language unless you first have this piece in place. So it sounds like you're missing a code analyzer for Go.




回答2:


As G. Ann said, you need to make sure you have the Language Parser Plugin installed.

SonarQube 7.x comes with SonarGo or you can use the information in my repo for more detailed info: https://github.com/Talderon/k8s-sonarqube-golang



来源:https://stackoverflow.com/questions/41768293/sonarqube-generic-coverage-sensor-fails-with-with-an-unknown-language-for-go

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!