minas
minas

Reputation: 230

Fail SonarQube quality gate if no tests were run

I'm running my builds on Jenkins with both SonarQube scanner and plugin for Maven builds. How to fail Quality Gate if no tests were run during that build ?

Upvotes: 0

Views: 657

Answers (1)

G. Ann - SonarSource Team
G. Ann - SonarSource Team

Reputation: 22804

You have two metrics you can use here: Unit Tests, and Unit Test Duration. This assumes that you're feeding in a test execution report which you can have created automatically when tests run. When they don't, 0's should be automatically filled for those metrics.

Upvotes: 1

Related Questions