Skip to content

Commit 477e127

Browse files
committed
Use views_v1 capability to restrict views tests
1 parent fb124c9 commit 477e127

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/views.csv-spec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
addressCountries
2+
require_capability: views_v1
3+
24
FROM address_countries
35
;
46

@@ -35,6 +37,8 @@ count:long | country:keyword
3537
;
3638

3739
airportsCountries
40+
require_capability: views_v1
41+
3842
FROM airports_countries
3943
;
4044

@@ -74,6 +78,8 @@ count:long | country:text
7478
;
7579

7680
languagesCountries
81+
require_capability: views_v1
82+
7783
FROM languages_countries
7884
;
7985

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ public enum Cap {
11091109
/**
11101110
* Views.
11111111
*/
1112-
VIEW_V1(Build.current().isSnapshot()),
1112+
VIEWS_V1(Build.current().isSnapshot()),
11131113

11141114
/**
11151115
* Support for the {@code leading_zeros} named parameter.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ public final void test() throws Throwable {
331331
"CSV tests cannot currently handle FORK",
332332
testCase.requiredCapabilities.contains(EsqlCapabilities.Cap.FORK_V9.capabilityName())
333333
);
334+
assumeFalse(
335+
"CSV tests cannot currently handle VIEWS",
336+
testCase.requiredCapabilities.contains(EsqlCapabilities.Cap.VIEWS_V1.capabilityName())
337+
);
334338
assumeFalse(
335339
"CSV tests cannot currently handle multi_match function that depends on Lucene",
336340
testCase.requiredCapabilities.contains(EsqlCapabilities.Cap.MULTI_MATCH_FUNCTION.capabilityName())

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/200_view.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ setup:
55
- method: POST
66
path: /_query
77
parameters: [ method, path, parameters, capabilities ]
8-
capabilities: [ views ]
8+
capabilities: [ views_v1 ]
99
reason: "Views not yet supported"
1010
test_runner_features: [capabilities]
1111
- do:

0 commit comments

Comments
 (0)