Skip to content

Commit f08e731

Browse files
authored
Disable histogram percentile tests when feature flag is not enabled (elastic#137714)
1 parent 87e82d1 commit f08e731

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/histogram/HistogramPercentileErrorTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
package org.elasticsearch.xpack.esql.expression.function.scalar.histogram;
99

1010
import org.elasticsearch.xpack.esql.core.expression.Expression;
11+
import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin;
1112
import org.elasticsearch.xpack.esql.core.tree.Source;
1213
import org.elasticsearch.xpack.esql.core.type.DataType;
1314
import org.elasticsearch.xpack.esql.expression.function.ErrorsForCasesWithoutExamplesTestCase;
1415
import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier;
1516
import org.hamcrest.Matcher;
17+
import org.junit.Before;
1618

1719
import java.util.List;
1820
import java.util.Set;
@@ -21,6 +23,14 @@
2123

2224
public class HistogramPercentileErrorTests extends ErrorsForCasesWithoutExamplesTestCase {
2325

26+
@Before
27+
public void setup() {
28+
assumeTrue(
29+
"Only when esql_exponential_histogram feature flag is enabled",
30+
EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()
31+
);
32+
}
33+
2434
@Override
2535
protected List<TestCaseSupplier> cases() {
2636
return paramsToSuppliers(HistogramPercentileTests.parameters());

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/histogram/HistogramPercentileSerializationTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@
77

88
package org.elasticsearch.xpack.esql.expression.function.scalar.histogram;
99

10+
import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin;
1011
import org.elasticsearch.xpack.esql.expression.AbstractExpressionSerializationTests;
12+
import org.junit.Before;
1113

1214
import java.io.IOException;
1315

1416
public class HistogramPercentileSerializationTests extends AbstractExpressionSerializationTests<HistogramPercentile> {
1517

18+
@Before
19+
public void setup() {
20+
assumeTrue(
21+
"Only when esql_exponential_histogram feature flag is enabled",
22+
EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()
23+
);
24+
}
25+
1626
@Override
1727
protected HistogramPercentile createTestInstance() {
1828
return new HistogramPercentile(randomSource(), randomChild(), randomChild());

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/histogram/HistogramPercentileTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
import org.elasticsearch.exponentialhistogram.ExponentialHistogram;
1414
import org.elasticsearch.exponentialhistogram.ExponentialHistogramQuantile;
1515
import org.elasticsearch.xpack.esql.core.expression.Expression;
16+
import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin;
1617
import org.elasticsearch.xpack.esql.core.tree.Source;
1718
import org.elasticsearch.xpack.esql.core.type.DataType;
1819
import org.elasticsearch.xpack.esql.expression.function.AbstractScalarFunctionTestCase;
1920
import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier;
21+
import org.junit.Before;
2022

2123
import java.util.ArrayList;
2224
import java.util.List;
@@ -29,6 +31,14 @@
2931

3032
public class HistogramPercentileTests extends AbstractScalarFunctionTestCase {
3133

34+
@Before
35+
public void setup() {
36+
assumeTrue(
37+
"Only when esql_exponential_histogram feature flag is enabled",
38+
EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()
39+
);
40+
}
41+
3242
public HistogramPercentileTests(@Name("TestCase") Supplier<TestCaseSupplier.TestCase> testCaseSupplier) {
3343
this.testCase = testCaseSupplier.get();
3444
}

0 commit comments

Comments
 (0)