From e6768d0eeb44fbb4e5c8562f01b30c349fb15558 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 8 Jan 2019 15:22:47 -0800 Subject: [PATCH] Build: Quiet naming convention logging 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. --- .../gradle/precommit/TestingConventionsTasks.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java index efa2684690703..0f207ad3fe1af 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java @@ -310,18 +310,18 @@ private boolean seemsLikeATest(Class clazz) { 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 @@ private boolean implementsNamingConvention(Class clazz) { 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;