-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Untested files are ignored for code coverage #56
Comments
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. |
@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
.The text was updated successfully, but these errors were encountered: