Browse Source

Test function count using list of functions (ESQL-1171)

This replaces that hard coded assertion of the count of functions with
one that reads from the registry of functions so it'll always be up to
date. In general the test is much weaker than the one we have in the
yaml which lists all of the functions. But it is fast. And now it'll
fail less.
Nik Everett 2 years ago
parent
commit
042ae49f4a

+ 2 - 1
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/EsqlActionIT.java

@@ -28,6 +28,7 @@ import org.elasticsearch.test.ESTestCase;
 import org.elasticsearch.xcontent.XContentBuilder;
 import org.elasticsearch.xcontent.json.JsonXContent;
 import org.elasticsearch.xpack.esql.analysis.VerificationException;
+import org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry;
 import org.junit.Assert;
 import org.junit.Before;
 
@@ -878,7 +879,7 @@ public class EsqlActionIT extends AbstractEsqlIntegTestCase {
     public void testShowFunctions() {
         EsqlQueryResponse results = run("show functions");
         assertThat(results.columns(), equalTo(List.of(new ColumnInfo("name", "keyword"), new ColumnInfo("synopsis", "keyword"))));
-        assertThat(results.values().size(), equalTo(32));
+        assertThat(results.values().size(), equalTo(new EsqlFunctionRegistry().listFunctions().size()));
     }
 
     public void testInWithNullValue() {