Skip to content

Commit 8c2f569

Browse files
authored
Add missing feature flag checks to Absent/PresentTests (#138807)
1 parent f6ffd56 commit 8c2f569

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AbsentTests.java

Lines changed: 9 additions & 4 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.xpack.esql.core.expression.Expression;
14+
import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin;
1415
import org.elasticsearch.xpack.esql.core.tree.Source;
1516
import org.elasticsearch.xpack.esql.core.type.DataType;
1617
import org.elasticsearch.xpack.esql.expression.function.AbstractAggregationTestCase;
@@ -61,7 +62,7 @@ public static Iterable<Object[]> parameters() {
6162
).flatMap(List::stream).map(AbsentTests::makeSupplier).collect(Collectors.toCollection(() -> suppliers));
6263

6364
// No rows
64-
for (var dataType : List.of(
65+
List<DataType> types = List.of(
6566
DataType.AGGREGATE_METRIC_DOUBLE,
6667
DataType.BOOLEAN,
6768
DataType.CARTESIAN_POINT,
@@ -78,9 +79,13 @@ public static Iterable<Object[]> parameters() {
7879
DataType.LONG,
7980
DataType.TEXT,
8081
DataType.UNSIGNED_LONG,
81-
DataType.VERSION,
82-
DataType.EXPONENTIAL_HISTOGRAM
83-
)) {
82+
DataType.VERSION
83+
);
84+
if (EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()) {
85+
types = new ArrayList<>(types);
86+
types.add(DataType.EXPONENTIAL_HISTOGRAM);
87+
}
88+
for (var dataType : types) {
8489
suppliers.add(
8590
new TestCaseSupplier(
8691
"No rows (" + dataType + ")",

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/PresentTests.java

Lines changed: 9 additions & 4 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.xpack.esql.core.expression.Expression;
14+
import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin;
1415
import org.elasticsearch.xpack.esql.core.tree.Source;
1516
import org.elasticsearch.xpack.esql.core.type.DataType;
1617
import org.elasticsearch.xpack.esql.expression.function.AbstractAggregationTestCase;
@@ -61,7 +62,7 @@ public static Iterable<Object[]> parameters() {
6162
).flatMap(List::stream).map(PresentTests::makeSupplier).collect(Collectors.toCollection(() -> suppliers));
6263

6364
// No rows
64-
for (var dataType : List.of(
65+
List<DataType> types = List.of(
6566
DataType.AGGREGATE_METRIC_DOUBLE,
6667
DataType.BOOLEAN,
6768
DataType.CARTESIAN_POINT,
@@ -78,9 +79,13 @@ public static Iterable<Object[]> parameters() {
7879
DataType.LONG,
7980
DataType.TEXT,
8081
DataType.UNSIGNED_LONG,
81-
DataType.VERSION,
82-
DataType.EXPONENTIAL_HISTOGRAM
83-
)) {
82+
DataType.VERSION
83+
);
84+
if (EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()) {
85+
types = new ArrayList<>(types);
86+
types.add(DataType.EXPONENTIAL_HISTOGRAM);
87+
}
88+
for (var dataType : types) {
8489
suppliers.add(
8590
new TestCaseSupplier(
8691
"No rows (" + dataType + ")",

0 commit comments

Comments
 (0)