|
@@ -1088,7 +1088,7 @@ public abstract class AbstractFunctionTestCase extends ESTestCase {
|
|
|
renderTypesTable(EsqlFunctionRegistry.description(definition).argNames());
|
|
|
return;
|
|
|
}
|
|
|
- LogManager.getLogger(getTestClass()).info("Skipping rendering types because the function isn't registered");
|
|
|
+ LogManager.getLogger(getTestClass()).info("Skipping rendering types because the function '" + name + "' isn't registered");
|
|
|
}
|
|
|
|
|
|
private static void renderTypesTable(List<String> argNames) throws IOException {
|
|
@@ -1116,12 +1116,18 @@ public abstract class AbstractFunctionTestCase extends ESTestCase {
|
|
|
[%header.monospaced.styled,format=dsv,separator=|]
|
|
|
|===
|
|
|
""" + header + "\n" + table.stream().collect(Collectors.joining("\n")) + "\n|===\n";
|
|
|
- LogManager.getLogger(getTestClass()).info("Writing function types:\n{}", rendered);
|
|
|
+ LogManager.getLogger(getTestClass()).info("Writing function types for [{}]:\n{}", functionName(), rendered);
|
|
|
writeToTempDir("types", rendered, "asciidoc");
|
|
|
}
|
|
|
|
|
|
private static String functionName() {
|
|
|
- return StringUtils.camelCaseToUnderscore(getTestClass().getSimpleName().replace("Tests", "")).toLowerCase(Locale.ROOT);
|
|
|
+ Class<?> testClass = getTestClass();
|
|
|
+ if (testClass.isAnnotationPresent(FunctionName.class)) {
|
|
|
+ FunctionName functionNameAnnotation = testClass.getAnnotation(FunctionName.class);
|
|
|
+ return functionNameAnnotation.value();
|
|
|
+ } else {
|
|
|
+ return StringUtils.camelCaseToUnderscore(testClass.getSimpleName().replace("Tests", "")).toLowerCase(Locale.ROOT);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private static FunctionDefinition definition(String name) {
|
|
@@ -1178,6 +1184,7 @@ public abstract class AbstractFunctionTestCase extends ESTestCase {
|
|
|
Files.createDirectories(dir);
|
|
|
Path file = dir.resolve(functionName() + "." + extension);
|
|
|
Files.writeString(file, str);
|
|
|
+ LogManager.getLogger(getTestClass()).info("Wrote function types for [{}] to file: {}", functionName(), file);
|
|
|
}
|
|
|
|
|
|
private final List<CircuitBreaker> breakers = Collections.synchronizedList(new ArrayList<>());
|