Coverage for removed tests

It seems like code coverage is not affected if we remove tests, which actually causes coverage to drop. Since the coverage check only considers new lines of code, we get a false positive when the quality gate passes.

It is important for us to keep our coverage up and not have the ability to drop it by removing tests.

Hey there!

You might be interested in joining a similar conversation here:

I have similar use case, using sonarcloud,

I set quality gate to new code coverage only,

then I create a PR, disabling one of the test class,

and no other changes,

the quality gate still passes

is this expected ?

In the context of a pull request, the current gate will not fail if code coverage decreases. This feature request (linked above) proposes a quality gate that ensures certain metrics, such as code coverage, can only improve (i.e., coverage can only increase and not decrease) as a result of changes.