Skip to content

Commit 86a3a59

Browse files
authored
ESQL: Add INLINESTATS capability requirement to tests (elastic#128556) (elastic#128559)
It looks like there are a bunch of tests that failed due to missing INLINESTATS capability. Resolves elastic#128512.
1 parent 0a58bc1 commit 86a3a59

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/session/IndexResolverFieldNamesTests.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public void testBasicFromCommand() {
3030
}
3131

3232
public void testBasicFromCommandWithInlinestats() {
33+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
3334
assertFieldNames("from test | inlinestats max(salary) by gender", ALL_FIELDS);
3435
}
3536

@@ -38,6 +39,7 @@ public void testBasicFromCommandWithMetadata() {
3839
}
3940

4041
public void testBasicFromCommandWithMetadata_AndInlinestats() {
42+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
4143
assertFieldNames("from test metadata _index, _id, _version | inlinestats max(salary)", ALL_FIELDS);
4244
}
4345

@@ -303,6 +305,7 @@ public void testLimitZero() {
303305
}
304306

305307
public void testLimitZero_WithInlinestats() {
308+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
306309
assertFieldNames("""
307310
FROM employees
308311
| INLINESTATS COUNT(*), MAX(salary) BY gender
@@ -317,6 +320,7 @@ public void testDocsDropHeight() {
317320
}
318321

319322
public void testDocsDropHeight_WithInlinestats() {
323+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
320324
assertFieldNames("""
321325
FROM employees
322326
| DROP height
@@ -332,6 +336,7 @@ public void testDocsDropHeightWithWildcard() {
332336
}
333337

334338
public void testDocsDropHeightWithWildcard_AndInlinestats() {
339+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
335340
assertFieldNames("""
336341
FROM employees
337342
| INLINESTATS MAX(salary) BY gender
@@ -498,6 +503,7 @@ public void testSortWithLimitOne_DropHeight() {
498503
}
499504

500505
public void testSortWithLimitOne_DropHeight_WithInlinestats() {
506+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
501507
assertFieldNames("from employees | inlinestats avg(salary) by languages | sort languages | limit 1 | drop height*", ALL_FIELDS);
502508
}
503509

@@ -797,6 +803,7 @@ public void testFilterById() {
797803
}
798804

799805
public void testFilterById_WithInlinestats() {
806+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
800807
assertFieldNames("FROM apps metadata _id | INLINESTATS max(rate) | WHERE _id == \"4\"", ALL_FIELDS);
801808
}
802809

@@ -1267,6 +1274,7 @@ public void testProjectDropPattern() {
12671274
}
12681275

12691276
public void testProjectDropPattern_WithInlinestats() {
1277+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
12701278
assertFieldNames("""
12711279
from test
12721280
| inlinestats max(foo) by bar
@@ -1349,6 +1357,7 @@ public void testCountAllAndOtherStatGrouped() {
13491357
}
13501358

13511359
public void testCountAllAndOtherStatGrouped_WithInlinestats() {
1360+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
13521361
assertFieldNames("""
13531362
from test
13541363
| inlinestats c = count(*), min = min(emp_no) by languages
@@ -1387,6 +1396,7 @@ public void testCountAllWithEval() {
13871396
}
13881397

13891398
public void testCountAllWithEval_AndInlinestats() {
1399+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
13901400
assertFieldNames("""
13911401
from test
13921402
| rename languages as l
@@ -1399,6 +1409,7 @@ public void testCountAllWithEval_AndInlinestats() {
13991409
}
14001410

14011411
public void testKeepAfterEval_AndInlinestats() {
1412+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
14021413
assertFieldNames("""
14031414
from test
14041415
| rename languages as l
@@ -1411,6 +1422,7 @@ public void testKeepAfterEval_AndInlinestats() {
14111422
}
14121423

14131424
public void testKeepBeforeEval_AndInlinestats() {
1425+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
14141426
assertFieldNames("""
14151427
from test
14161428
| rename languages as l
@@ -1423,6 +1435,7 @@ public void testKeepBeforeEval_AndInlinestats() {
14231435
}
14241436

14251437
public void testStatsBeforeEval_AndInlinestats() {
1438+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
14261439
assertFieldNames("""
14271440
from test
14281441
| rename languages as l
@@ -1434,6 +1447,7 @@ public void testStatsBeforeEval_AndInlinestats() {
14341447
}
14351448

14361449
public void testStatsBeforeInlinestats() {
1450+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
14371451
assertFieldNames("""
14381452
from test
14391453
| stats min = min(salary) by languages
@@ -1442,6 +1456,7 @@ public void testStatsBeforeInlinestats() {
14421456
}
14431457

14441458
public void testKeepBeforeInlinestats() {
1459+
assumeTrue("INLINESTATS required", EsqlCapabilities.Cap.INLINESTATS_V7.isEnabled());
14451460
assertFieldNames("""
14461461
from test
14471462
| keep languages, salary

0 commit comments

Comments
 (0)