Skip to content

Commit 65b3256

Browse files
committed
Add capability check for tests
1 parent 524c93c commit 65b3256

File tree

1 file changed

+7
-0
lines changed
  • x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext

1 file changed

+7
-0
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/fulltext/KnnTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
1212

1313
import org.elasticsearch.index.query.QueryBuilder;
14+
import org.elasticsearch.xpack.esql.action.EsqlCapabilities;
1415
import org.elasticsearch.xpack.esql.core.expression.Expression;
1516
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
1617
import org.elasticsearch.xpack.esql.core.expression.Literal;
@@ -22,6 +23,7 @@
2223
import org.elasticsearch.xpack.esql.expression.function.vector.Knn;
2324
import org.elasticsearch.xpack.esql.io.stream.PlanStreamOutput;
2425
import org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates;
26+
import org.junit.Before;
2527

2628
import java.util.ArrayList;
2729
import java.util.List;
@@ -46,6 +48,11 @@ public static Iterable<Object[]> parameters() {
4648
return parameterSuppliersFromTypedData(addFunctionNamedParams(testCaseSuppliers()));
4749
}
4850

51+
@Before
52+
public void checkCapability() {
53+
assumeTrue("KNN is not enabled", EsqlCapabilities.Cap.KNN_FUNCTION.isEnabled());
54+
}
55+
4956
private static List<TestCaseSupplier> testCaseSuppliers() {
5057
List<TestCaseSupplier> suppliers = new ArrayList<>();
5158

0 commit comments

Comments
 (0)