Skip to content

Commit 1caa5c8

Browse files
Rest test fixes (#27354)
* REST: Rename ingest.processor.grok to ingest.processor_grok * REST: Rename remote.info to cluster.remote_info * REST: Fixed bad YAML comments * REST: Force dummy scripts to be strings, not numbers * REST: Fix bad YAML in search/110_field_collapsing.yml * REST: Adjust percentile tests to work with Perl number handling
1 parent 2e86357 commit 1caa5c8

File tree

15 files changed

+238
-253
lines changed

15 files changed

+238
-253
lines changed

modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/120_grok.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ teardown:
158158
---
159159
"Test Grok Patterns Retrieval":
160160
- do:
161-
ingest.processor.grok: {}
161+
ingest.processor_grok: {}
162162
- length: { patterns: 303 }
163163
- match: { patterns.PATH: "(?:%{UNIXPATH}|%{WINPATH})" }

qa/multi-cluster-search/src/test/resources/rest-api-spec/test/multi_cluster/20_info.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Fetch remote cluster info for existing cluster":
33

44
- do:
5-
remote.info: {}
5+
cluster.remote_info: {}
66
- match: { my_remote_cluster.connected: true }
77
- match: { my_remote_cluster.num_nodes_connected: 1}
88
- match: { my_remote_cluster.max_connections_per_cluster: 1}
@@ -37,7 +37,7 @@
3737
- match: { hits.hits.0._index: "test_remote_cluster:test_index" }
3838

3939
- do:
40-
remote.info: {}
40+
cluster.remote_info: {}
4141
- set: { my_remote_cluster.http_addresses.0: remote_http }
4242
- match: { test_remote_cluster.http_addresses.0: $remote_http }
4343

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"remote.info": {
2+
"cluster.remote_info": {
33
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html",
44
"methods": ["GET"],
55
"url": {
@@ -9,4 +9,4 @@
99
},
1010
"body": null
1111
}
12-
}
12+
}

rest-api-spec/src/main/resources/rest-api-spec/api/ingest.processor.grok.json renamed to rest-api-spec/src/main/resources/rest-api-spec/api/ingest.processor_grok.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"ingest.processor.grok": {
2+
"ingest.processor_grok": {
33
"documentation": "https://www.elastic.co/guide/en/elasticsearch/plugins/master/ingest.html",
44
"methods": [ "GET" ],
55
"url": {

rest-api-spec/src/main/resources/rest-api-spec/test/remote.info/10_info.yml renamed to rest-api-spec/src/main/resources/rest-api-spec/test/cluster.remote_info/10_info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
version: " - 5.3.99"
55
reason: this API doesn't exist in 5.3.x yet
66
- do:
7-
remote.info: {}
7+
cluster.remote_info: {}
88
- is_true: ''
99

rest-api-spec/src/main/resources/rest-api-spec/test/indices.exists_type/10_basic.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
"Exists type":
33
- skip:
4-
version: "5.99.99 - "# this will only run in a mixed cluster environment with at least 1 5.x node
4+
# this will only run in a mixed cluster environment with at least 1 5.x node
5+
version: "5.99.99 - "
56
reason: multiple types are not supported on 6.x indices onwards
67

78
- do:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/70_legacy_multi_type.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
setup:
33

44
- skip:
5-
version: "5.99.99 - " # this will only run in a mixed cluster environment with at least 1 5.x node
5+
# this will only run in a mixed cluster environment with at least 1 5.x node
6+
version: "5.99.99 - "
67
reason: multiple types are not supported on 6.x indices onwards
78

89
- do:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
type: test
1818
id: "1"
1919
body: { "foo": "hello world" }
20-
refresh: true # make this doc visible in index stats
21-
20+
# make this doc visible in index stats
21+
refresh: true
22+
2223
- do:
2324
get:
2425
index: logs_search

rest-api-spec/src/main/resources/rest-api-spec/test/mget/15_ids.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
"IDs":
33
- skip:
4-
version: "5.99.99 - "# this will only run in a mixed cluster environment with at least 1 5.x node
4+
# this will only run in a mixed cluster environment with at least 1 5.x node
5+
version: "5.99.99 - "
56
reason: multiple types are not supported on 6.x indices onwards
67

78
- do:

rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/180_percentiles_tdigest_metric.yml

Lines changed: 100 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,24 @@ setup:
6262
percentiles:
6363
field: double_field
6464

65-
66-
- match: { hits.total: 4 }
65+
- match: { hits.total: 4 }
6766
- length: { hits.hits: 4 }
68-
- match:
69-
aggregations.percentiles_int.values:
70-
"1.0": 2.5
71-
"5.0": 8.500000000000002
72-
"25.0": 38.5
73-
"50.0": 76.0
74-
"75.0": 113.5
75-
"95.0": 143.49999999999997
76-
"99.0": 149.5
77-
- match:
78-
aggregations.percentiles_double.values:
79-
"1.0": 2.5
80-
"5.0": 8.500000000000002
81-
"25.0": 38.5
82-
"50.0": 76.0
83-
"75.0": 113.5
84-
"95.0": 143.49999999999997
85-
"99.0": 149.5
67+
68+
- match: { aggregations.percentiles_int.values.1\.0: 2.5 }
69+
- match: { aggregations.percentiles_int.values.5\.0: 8.500000000000002 }
70+
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
71+
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
72+
- match: { aggregations.percentiles_int.values.75\.0: 113.5 }
73+
- match: { aggregations.percentiles_int.values.95\.0: 143.49999999999997 }
74+
- match: { aggregations.percentiles_int.values.99\.0: 149.5 }
75+
76+
- match: { aggregations.percentiles_double.values.1\.0: 2.5 }
77+
- match: { aggregations.percentiles_double.values.5\.0: 8.500000000000002 }
78+
- match: { aggregations.percentiles_double.values.25\.0: 38.5 }
79+
- match: { aggregations.percentiles_double.values.50\.0: 76.0 }
80+
- match: { aggregations.percentiles_double.values.75\.0: 113.5 }
81+
- match: { aggregations.percentiles_double.values.95\.0: 143.49999999999997 }
82+
- match: { aggregations.percentiles_double.values.99\.0: 149.5 }
8683

8784
- do:
8885
search:
@@ -102,24 +99,23 @@ setup:
10299

103100
- match: { hits.total: 4 }
104101
- length: { hits.hits: 4 }
105-
- match:
106-
aggregations.percentiles_int.values:
107-
"1.0": 2.5
108-
"5.0": 8.500000000000002
109-
"25.0": 38.5
110-
"50.0": 76.0
111-
"75.0": 113.5
112-
"95.0": 143.49999999999997
113-
"99.0": 149.5
114-
- match:
115-
aggregations.percentiles_double.values:
116-
"1.0": 2.5
117-
"5.0": 8.500000000000002
118-
"25.0": 38.5
119-
"50.0": 76.0
120-
"75.0": 113.5
121-
"95.0": 143.49999999999997
122-
"99.0": 149.5
102+
103+
- match: { aggregations.percentiles_int.values.1\.0: 2.5 }
104+
- match: { aggregations.percentiles_int.values.5\.0: 8.500000000000002 }
105+
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
106+
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
107+
- match: { aggregations.percentiles_int.values.75\.0: 113.5 }
108+
- match: { aggregations.percentiles_int.values.95\.0: 143.49999999999997 }
109+
- match: { aggregations.percentiles_int.values.99\.0: 149.5 }
110+
111+
- match: { aggregations.percentiles_double.values.1\.0: 2.5 }
112+
- match: { aggregations.percentiles_double.values.5\.0: 8.500000000000002 }
113+
- match: { aggregations.percentiles_double.values.25\.0: 38.5 }
114+
- match: { aggregations.percentiles_double.values.50\.0: 76.0 }
115+
- match: { aggregations.percentiles_double.values.75\.0: 113.5 }
116+
- match: { aggregations.percentiles_double.values.95\.0: 143.49999999999997 }
117+
- match: { aggregations.percentiles_double.values.99\.0: 149.5 }
118+
123119

124120
---
125121
"Only aggs test":
@@ -138,24 +134,24 @@ setup:
138134

139135
- match: { hits.total: 4 }
140136
- length: { hits.hits: 0 }
141-
- match:
142-
aggregations.percentiles_int.values:
143-
"1.0": 2.5
144-
"5.0": 8.500000000000002
145-
"25.0": 38.5
146-
"50.0": 76.0
147-
"75.0": 113.5
148-
"95.0": 143.49999999999997
149-
"99.0": 149.5
150-
- match:
151-
aggregations.percentiles_double.values:
152-
"1.0": 2.5
153-
"5.0": 8.500000000000002
154-
"25.0": 38.5
155-
"50.0": 76.0
156-
"75.0": 113.5
157-
"95.0": 143.49999999999997
158-
"99.0": 149.5
137+
138+
- match: { aggregations.percentiles_int.values.1\.0: 2.5 }
139+
- match: { aggregations.percentiles_int.values.5\.0: 8.500000000000002 }
140+
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
141+
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
142+
- match: { aggregations.percentiles_int.values.75\.0: 113.5 }
143+
- match: { aggregations.percentiles_int.values.95\.0: 143.49999999999997 }
144+
- match: { aggregations.percentiles_int.values.99\.0: 149.5 }
145+
146+
- match: { aggregations.percentiles_double.values.1\.0: 2.5 }
147+
- match: { aggregations.percentiles_double.values.5\.0: 8.500000000000002 }
148+
- match: { aggregations.percentiles_double.values.25\.0: 38.5 }
149+
- match: { aggregations.percentiles_double.values.50\.0: 76.0 }
150+
- match: { aggregations.percentiles_double.values.75\.0: 113.5 }
151+
- match: { aggregations.percentiles_double.values.95\.0: 143.49999999999997 }
152+
- match: { aggregations.percentiles_double.values.99\.0: 149.5 }
153+
154+
159155

160156
---
161157
"Filtered test":
@@ -179,24 +175,22 @@ setup:
179175

180176
- match: { hits.total: 3 }
181177
- length: { hits.hits: 3 }
182-
- match:
183-
aggregations.percentiles_int.values:
184-
"1.0": 52.0
185-
"5.0": 56.0
186-
"25.0": 76.0
187-
"50.0": 101.0
188-
"75.0": 126.0
189-
"95.0": 146.0
190-
"99.0": 150.0
191-
- match:
192-
aggregations.percentiles_double.values:
193-
"1.0": 52.0
194-
"5.0": 56.0
195-
"25.0": 76.0
196-
"50.0": 101.0
197-
"75.0": 126.0
198-
"95.0": 146.0
199-
"99.0": 150.0
178+
179+
- match: { aggregations.percentiles_int.values.1\.0: 52.0 }
180+
- match: { aggregations.percentiles_int.values.5\.0: 56.0 }
181+
- match: { aggregations.percentiles_int.values.25\.0: 76.0 }
182+
- match: { aggregations.percentiles_int.values.50\.0: 101.0 }
183+
- match: { aggregations.percentiles_int.values.75\.0: 126.0 }
184+
- match: { aggregations.percentiles_int.values.95\.0: 146.0 }
185+
- match: { aggregations.percentiles_int.values.99\.0: 150.0 }
186+
187+
- match: { aggregations.percentiles_double.values.1\.0: 52.0 }
188+
- match: { aggregations.percentiles_double.values.5\.0: 56.0 }
189+
- match: { aggregations.percentiles_double.values.25\.0: 76.0 }
190+
- match: { aggregations.percentiles_double.values.50\.0: 101.0 }
191+
- match: { aggregations.percentiles_double.values.75\.0: 126.0 }
192+
- match: { aggregations.percentiles_double.values.95\.0: 146.0 }
193+
- match: { aggregations.percentiles_double.values.99\.0: 150.0 }
200194

201195
---
202196
"Missing field with missing param":
@@ -212,15 +206,14 @@ setup:
212206

213207
- match: { hits.total: 4 }
214208
- length: { hits.hits: 4 }
215-
- match:
216-
aggregations.percentiles_missing.values:
217-
"1.0": 1.0
218-
"5.0": 1.0
219-
"25.0": 1.0
220-
"50.0": 1.0
221-
"75.0": 1.0
222-
"95.0": 1.0
223-
"99.0": 1.0
209+
210+
- match: { aggregations.percentiles_missing.values.1\.0: 1.0 }
211+
- match: { aggregations.percentiles_missing.values.5\.0: 1.0 }
212+
- match: { aggregations.percentiles_missing.values.25\.0: 1.0 }
213+
- match: { aggregations.percentiles_missing.values.50\.0: 1.0 }
214+
- match: { aggregations.percentiles_missing.values.75\.0: 1.0 }
215+
- match: { aggregations.percentiles_missing.values.95\.0: 1.0 }
216+
- match: { aggregations.percentiles_missing.values.99\.0: 1.0 }
224217

225218
---
226219
"Missing field without missing param":
@@ -253,15 +246,15 @@ setup:
253246
- match: { hits.total: 4 }
254247
- length: { hits.hits: 4 }
255248
- match: { aggregations.percentiles_int.meta.foo: "bar" }
256-
- match:
257-
aggregations.percentiles_int.values:
258-
"1.0": 2.5
259-
"5.0": 8.500000000000002
260-
"25.0": 38.5
261-
"50.0": 76.0
262-
"75.0": 113.5
263-
"95.0": 143.49999999999997
264-
"99.0": 149.5
249+
250+
251+
- match: { aggregations.percentiles_int.values.1\.0: 2.5 }
252+
- match: { aggregations.percentiles_int.values.5\.0: 8.500000000000002 }
253+
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
254+
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
255+
- match: { aggregations.percentiles_int.values.75\.0: 113.5 }
256+
- match: { aggregations.percentiles_int.values.95\.0: 143.49999999999997 }
257+
- match: { aggregations.percentiles_int.values.99\.0: 149.5 }
265258

266259
---
267260
"Invalid params test":
@@ -335,16 +328,14 @@ setup:
335328

336329
- match: { hits.total: 4 }
337330
- length: { hits.hits: 4 }
338-
- match:
339-
aggregations.percentiles_int.values:
340-
5.0: 8.500000000000002
341-
25.0: 38.5
342-
50.0: 76.0
343-
- match:
344-
aggregations.percentiles_double.values:
345-
5.0: 8.500000000000002
346-
25.0: 38.5
347-
50.0: 76.0
331+
332+
- match: { aggregations.percentiles_int.values.5\.0: 8.500000000000002 }
333+
- match: { aggregations.percentiles_int.values.25\.0: 38.5 }
334+
- match: { aggregations.percentiles_int.values.50\.0: 76.0 }
335+
336+
- match: { aggregations.percentiles_double.values.5\.0: 8.500000000000002 }
337+
- match: { aggregations.percentiles_double.values.25\.0: 38.5 }
338+
- match: { aggregations.percentiles_double.values.50\.0: 76.0 }
348339

349340
---
350341
"Non-keyed test":
@@ -362,14 +353,13 @@ setup:
362353

363354
- match: { hits.total: 4 }
364355
- length: { hits.hits: 4 }
365-
- match:
366-
aggregations.percentiles_int.values:
367-
- key: 5.0
368-
value: 8.500000000000002
369-
- key: 25.0
370-
value: 38.5
371-
- key: 50.0
372-
value: 76.0
356+
357+
- match: { aggregations.percentiles_int.values.0.key: 5.0 }
358+
- match: { aggregations.percentiles_int.values.0.value: 8.500000000000002 }
359+
- match: { aggregations.percentiles_int.values.1.key: 25.0 }
360+
- match: { aggregations.percentiles_int.values.1.value: 38.5 }
361+
- match: { aggregations.percentiles_int.values.2.key: 50.0 }
362+
- match: { aggregations.percentiles_int.values.2.value: 76.0 }
373363

374364

375365

0 commit comments

Comments
 (0)