]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6143 update default QG to be fully based on water leak period 538/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 25 Sep 2015 14:56:51 +0000 (16:56 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 25 Sep 2015 16:08:08 +0000 (18:08 +0200)
server/sonar-server/src/main/java/org/sonar/server/qualitygate/RegisterQualityGates.java
server/sonar-server/src/test/java/org/sonar/server/qualitygate/RegisterQualityGatesTest.java

index 8231be32e31c4c2c735bd0d76f63ebba92014b88..e16ba4733486150bd7013c271465291fbe7e078e 100644 (file)
@@ -57,15 +57,10 @@ public class RegisterQualityGates implements Startable {
 
   private void createBuiltinQualityGate() {
     QualityGateDto builtin = qualityGates.create(BUILTIN_QUALITY_GATE);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.BLOCKER_VIOLATIONS_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "0", null);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.CRITICAL_VIOLATIONS_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "0", 3);
+    qualityGates.createCondition(builtin.getId(), CoreMetrics.NEW_BLOCKER_VIOLATIONS_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "0", 3);
+    qualityGates.createCondition(builtin.getId(), CoreMetrics.NEW_CRITICAL_VIOLATIONS_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "0", 3);
     qualityGates.createCondition(builtin.getId(), CoreMetrics.NEW_SQALE_DEBT_RATIO_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "5", 3);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.TEST_ERRORS_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "0", null);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.TEST_FAILURES_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, null, "0", null);
     qualityGates.createCondition(builtin.getId(), CoreMetrics.NEW_COVERAGE_KEY, QualityGateConditionDto.OPERATOR_LESS_THAN, null, "80", 3);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.OPEN_ISSUES_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, "0", null, null);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.REOPENED_ISSUES_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, "0", null, null);
-    qualityGates.createCondition(builtin.getId(), CoreMetrics.SKIPPED_TESTS_KEY, QualityGateConditionDto.OPERATOR_GREATER_THAN, "0", null, null);
   }
 
   private void registerBuiltinQualityGate() {
index 02bc0868677d2798bce8531e03eef2b00ba25d25..953adf4388358f7c5d1ba2c1b37311484b07a4c1 100644 (file)
@@ -59,7 +59,7 @@ public class RegisterQualityGatesTest {
 
     verify(templateDao).countByTypeAndKey(templateType, templateName);
     verify(qualityGates).create(templateName);
-    verify(qualityGates, times(9)).createCondition(anyLong(), anyString(), anyString(), anyString(), anyString(), anyInt());
+    verify(qualityGates, times(4)).createCondition(anyLong(), anyString(), anyString(), anyString(), anyString(), anyInt());
     ArgumentCaptor<LoadedTemplateDto> templateArg = ArgumentCaptor.forClass(LoadedTemplateDto.class);
     verify(templateDao).insert(templateArg.capture());
     LoadedTemplateDto template = templateArg.getValue();