Reject PR in Azure DevOps when test coverage is low (SonarCloud)


(Roman Borysenok) #1

Good day,

I successfully setup integration of Azure DevOps with SonarCloud.
On each PR it triggers a build and check the required approval from the SonarCloud GualityGate.
But I can’t figure out how to add final piece (reject PR if Code Coverage is less then 80%).
For now I’m using default “Sonar way” gate that has this check by default, but when I submit PR with 0.0% Test coverage it pass the Quality Gate check.
image
What else should I add so GualityGate will fail if test coverage in PR is less then 80%?

Thanks!


(G Ann Campbell) #2

Hi,

Right now PRs are checked with a hard-coded gate: no Open issues. We’re planning to get there though. You can follow this ticket to watch our progress:

MMF-1369 - Real Quality Gates for PRs and short-lived branches

 
Ann


Quality Gate + Short Lived Branches
(Roman Borysenok) #3

Hi Ann,

Thank you for the reply.
It will be a really great feature, as previously mentioned in other conversations, we need to manage our Quality Gate before code gets to the long lived branch.

Thanks!