Browse Source

Build: Quiet naming convention logging (#37244)

This commit moves log statements related to classification of naming
convention checks for tests to debug level. At info level they emit an
enormous amount of output in CI, while these are not generally useful
for debugging normal build failures.
Ryan Ernst 6 years ago
parent
commit
29c895b55c

+ 4 - 4
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java

@@ -310,18 +310,18 @@ public class TestingConventionsTasks extends DefaultTask {
 
             Class<?> junitTest = loadClassWithoutInitializing("org.junit.Assert", classLoader);
             if (junitTest.isAssignableFrom(clazz)) {
-                getLogger().info("{} is a test because it extends {}", clazz.getName(), junitTest.getName());
+                getLogger().debug("{} is a test because it extends {}", clazz.getName(), junitTest.getName());
                 return true;
             }
 
             Class<?> junitAnnotation = loadClassWithoutInitializing("org.junit.Test", classLoader);
             for (Method method : clazz.getMethods()) {
                 if (matchesTestMethodNamingConvention(method)) {
-                    getLogger().info("{} is a test because it has method named '{}'", clazz.getName(), method.getName());
+                    getLogger().debug("{} is a test because it has method named '{}'", clazz.getName(), method.getName());
                     return true;
                 }
                 if (isAnnotated(method, junitAnnotation)) {
-                    getLogger().info("{} is a test because it has method '{}' annotated with '{}'",
+                    getLogger().debug("{} is a test because it has method '{}' annotated with '{}'",
                         clazz.getName(), method.getName(), junitAnnotation.getName());
                     return true;
                 }
@@ -340,7 +340,7 @@ public class TestingConventionsTasks extends DefaultTask {
         if (naming.stream()
             .map(TestingConventionRule::getSuffix)
             .anyMatch(suffix -> clazz.getName().endsWith(suffix))) {
-            getLogger().info("{} is a test because it matches the naming convention", clazz.getName());
+            getLogger().debug("{} is a test because it matches the naming convention", clazz.getName());
             return true;
         }
         return false;