From eae83cb489c6ceb576efdac84304ec4b1d42addc Mon Sep 17 00:00:00 2001 From: Mark Tozzi Date: Mon, 8 Sep 2025 11:36:24 -0400 Subject: [PATCH] forgot all these tests need a capability gate as well --- .../rules/logical/local/IgnoreNullMetricsTests.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/local/IgnoreNullMetricsTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/local/IgnoreNullMetricsTests.java index 5faa73b3aec7f..7b60246d8fc7a 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/local/IgnoreNullMetricsTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/local/IgnoreNullMetricsTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.index.IndexMode; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.esql.EsqlTestUtils; +import org.elasticsearch.xpack.esql.action.EsqlCapabilities; import org.elasticsearch.xpack.esql.analysis.Analyzer; import org.elasticsearch.xpack.esql.analysis.AnalyzerContext; import org.elasticsearch.xpack.esql.analysis.AnalyzerTestUtils; @@ -115,6 +116,7 @@ private LogicalPlan localPlan(String query) { } public void testSimple() { + assumeTrue("requires metrics command", EsqlCapabilities.Cap.METRICS_COMMAND.isEnabled()); LogicalPlan actual = localPlan(""" TS test | STATS max(max_over_time(metric_1)) @@ -144,7 +146,7 @@ public void testRuleDoesNotApplyInNonTSMode() { } public void testDimensionsAreNotFiltered() { - + assumeTrue("requires metrics command", EsqlCapabilities.Cap.METRICS_COMMAND.isEnabled()); LogicalPlan actual = localPlan(""" TS test | STATS max(max_over_time(metric_1)) BY dimension_1 @@ -161,7 +163,7 @@ public void testDimensionsAreNotFiltered() { } public void testFiltersAreJoinedWithOr() { - + assumeTrue("requires metrics command", EsqlCapabilities.Cap.METRICS_COMMAND.isEnabled()); LogicalPlan actual = localPlan(""" TS test | STATS max(max_over_time(metric_1)), min(min_over_time(metric_2)) @@ -197,6 +199,7 @@ public void testFiltersAreJoinedWithOr() { public void testSkipCoalescedMetrics() { // Note: this test is passing because the reference attribute metric_2 in the stats block does not inherit the // metric property from the original field. + assumeTrue("requires metrics command", EsqlCapabilities.Cap.METRICS_COMMAND.isEnabled()); LogicalPlan actual = localPlan(""" TS test | EVAL metric_2 = coalesce(metric_2, 0) @@ -218,6 +221,7 @@ public void testSkipCoalescedMetrics() { * check that stats blocks after the first are not sourced for adding metrics to the filter */ public void testMultipleStats() { + assumeTrue("requires metrics command", EsqlCapabilities.Cap.METRICS_COMMAND.isEnabled()); LogicalPlan actual = localPlan(""" TS test | STATS m = max(max_over_time(metric_1)) @@ -232,6 +236,5 @@ public void testMultipleStats() { IsNotNull condition = as(filter.condition(), IsNotNull.class); FieldAttribute attribute = as(condition.field(), FieldAttribute.class); assertEquals("metric_1", attribute.fieldName().string()); - } }