Open kernle32dll opened 6 years ago
We provide the per file coverage to SonarQube. The total coverage is then computed automatically by SonarQube.
Since we provide metrics only for the files found in the coverage xml file, the other classes have no coverage information, thus are "ignored" in the coverage computation.
We can add a new property to force to 0% untested files, just like JaCoCo plugin.
@thibaultfalque If we want to implement this, we probably need a new type of files (test files) in our plugin.
I asked for correctly detect source code file and test file. https://groups.google.com/forum/#!topic/sonarqube/4CkPFEKYRpc
@Kernle32DLL can you test the new release.
@thibaultfalque works like a charm. Might be worth to include the parameters as stated in https://github.com/uartois/sonar-golang/releases/tag/v1.2.11-rc10 as sensible defaults.
I searched a solution for add default value but it's not directly possible because properties are sonar properties and not plugin properties, so I can't set a default value. You can change the default value of these properties from the web interface.
Description
I noticed that files which are not tested at all do not decrease the code coverage. E.g. a project with two files, with one being 100% tested and the other not at all, code coverage in total will still be 100%.
Steps to Reproduce
main.go
andtest.go
)test.go
test.go
, not onmain.go
Additional Information
If coverage for untested files should be ignored or set to 0 is a choice of preference. Thus, it should be settable via
sonar-project.properties
.