Skip to content
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

Disable code coverage report on Gitlabci #285

Open
LaSylv opened this issue Dec 8, 2020 · 5 comments
Open

Disable code coverage report on Gitlabci #285

LaSylv opened this issue Dec 8, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@LaSylv
Copy link

LaSylv commented Dec 8, 2020

Describe the bug

Disable the coverage pushed to gitlab, as it is sometimes not correct and gitlab already provides this feature.

Expected behavior

It wold be nice to be able to disable the coverage pushed by the plugin through a specific property.

Additional context

As we already use the coverage through gitlab (more complete, showing which lines are covered or not), the sonar gitlab is a pain to set and never seem to be correct. We would like to disable it entirely when it's pushed to gitlab.

If this is somzthing you would consider, I can work on a PR

@LaSylv LaSylv added the bug Something isn't working label Dec 8, 2020
@mc1arke mc1arke added enhancement New feature or request and removed bug Something isn't working labels Dec 9, 2020
@lucasoares
Copy link

@Glosur, what you mean about disabling coverage pushed to gitlab?

Is the coverage provided by the external job created by the plugin?

image

If so, I agree with you because the final coverage displayed on the MR page will be incorrect since it will show the average coverage between my test and the coverage of the new code.

For example, if I have one MR with only 1 changed line that doesn't is covered by tests, the widget will report an incorrect coverage of (test coverage + sonar coverage) / 2:

image

@LaSylv
Copy link
Author

LaSylv commented Feb 24, 2021

Yes, we are having the problem you're saying, that is heavily linked with #225

We use another gitlabci job to get the covergae from. Gitlab then also receives the coverage from the sonar plugin (the coverage is not the correct one, see PR linked)

In the end, even if the PR is fixed, I have to maintain two tools to have the coverage in the gitlabci job matching the one in sonar

@lucasoares
Copy link

lucasoares commented Aug 11, 2022

Even with #225 merged we are having this problem as well.

I just ran an analysis with sonarqube 9.5 and with plugin version 1.12.0 and the reported coverage in the SonarQube external job is the new code coverage and not the total coverage.

image

image

@Karql
Copy link

Karql commented Mar 21, 2023

Hi @mc1arke

Regression to #225 was made in this change: #577 (review)

The coverage send back via the GitLab API should be the total coverage of the project, not the coverage of the new code in the PR.

Best regards,
Mateusz

@mhagnumdw
Copy link

mhagnumdw commented Jan 31, 2024

I just came across this issue having the same problem as you.

Sonarqube Community Edition Version 9.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants