Skip to content

Commit 06888e0

Browse files
committed
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.
1 parent ffa0692 commit 06888e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,18 @@ private boolean seemsLikeATest(Class<?> clazz) {
310310

311311
Class<?> junitTest = loadClassWithoutInitializing("org.junit.Assert", classLoader);
312312
if (junitTest.isAssignableFrom(clazz)) {
313-
getLogger().info("{} is a test because it extends {}", clazz.getName(), junitTest.getName());
313+
getLogger().debug("{} is a test because it extends {}", clazz.getName(), junitTest.getName());
314314
return true;
315315
}
316316

317317
Class<?> junitAnnotation = loadClassWithoutInitializing("org.junit.Test", classLoader);
318318
for (Method method : clazz.getMethods()) {
319319
if (matchesTestMethodNamingConvention(method)) {
320-
getLogger().info("{} is a test because it has method named '{}'", clazz.getName(), method.getName());
320+
getLogger().debug("{} is a test because it has method named '{}'", clazz.getName(), method.getName());
321321
return true;
322322
}
323323
if (isAnnotated(method, junitAnnotation)) {
324-
getLogger().info("{} is a test because it has method '{}' annotated with '{}'",
324+
getLogger().debug("{} is a test because it has method '{}' annotated with '{}'",
325325
clazz.getName(), method.getName(), junitAnnotation.getName());
326326
return true;
327327
}
@@ -340,7 +340,7 @@ private boolean implementsNamingConvention(Class<?> clazz) {
340340
if (naming.stream()
341341
.map(TestingConventionRule::getSuffix)
342342
.anyMatch(suffix -> clazz.getName().endsWith(suffix))) {
343-
getLogger().info("{} is a test because it matches the naming convention", clazz.getName());
343+
getLogger().debug("{} is a test because it matches the naming convention", clazz.getName());
344344
return true;
345345
}
346346
return false;

0 commit comments

Comments
 (0)