- Sonarqube Enterprise v8.8
- Jacoco v8.6
- Android, Kotlin, Java project
We have a project that is doing branch analysis on merge requests and has a quality gate on new code coverage that fails if the new code coverage is below 65% for any given branch analysis. There is a branch that has 30 lines of new code, but only 2 lines of testable code (the other 28 lines are a new test class that adds coverage for code that existed prior to the merge request).
Some questions we have are:
- Can we configure sonarqube to ignore lines of untestable code (like for example, our test class) in the threshold for enforcing a quality gate (referring to [SONAR-9352] Quality gate should not fail when too few new lines of code - SonarSource it seems to be 20 lines or greater)
- Does the “estimated coverage after merge” take into account tests that are added to cover code that existed prior to the MR?