Skip to content

Commit 21e392e

Browse files
authored
Removes typed calls from YAML REST tests (#37611)
This PR attempts to remove all typed calls from our YAML REST tests. The PR adds include_type_name: false to create index requests that use a mapping and also to put mapping requests. It also removes _type from index requests where they haven't already been removed. The PR ignores tests named *_with_types.yml since this are specifically testing typed API behaviour. The change also includes changing the test harness to add the type _doc to index, update, get and bulk requests that do not specify the document type when the test is running against a mixed 7.x/6.x cluster.
1 parent 2f7776c commit 21e392e

File tree

245 files changed

+1433
-2342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+1433
-2342
lines changed

modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/20_empty_bucket.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,27 @@
22
"Empty Bucket Aggregation":
33
- do:
44
indices.create:
5+
include_type_name: false
56
index: empty_bucket_idx
67
body:
78
settings:
89
number_of_shards: "3"
910
mappings:
10-
test:
11-
"properties":
12-
"value":
13-
"type": "integer"
14-
"val1":
15-
"type": "double"
11+
"properties":
12+
"value":
13+
"type": "integer"
14+
"val1":
15+
"type": "double"
1616

1717
- do:
1818
index:
1919
index: empty_bucket_idx
20-
type: test
2120
id: 1
2221
body: { "value": 0, "val1": 3.1 }
2322

2423
- do:
2524
index:
2625
index: empty_bucket_idx
27-
type: test
2826
id: 2
2927
body: { "value": 2, "val1": -3.1 }
3028

modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/30_single_value_field.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ setup:
33

44
- do:
55
indices.create:
6+
include_type_name: false
67
index: test
78
body:
89
settings:
910
number_of_shards: 3
1011
number_of_routing_shards: 3
1112
mappings:
12-
test:
13-
"properties":
14-
"val1":
15-
"type": "double"
16-
"val2":
17-
"type": "double"
18-
"val3":
19-
"type": "double"
13+
"properties":
14+
"val1":
15+
"type": "double"
16+
"val2":
17+
"type": "double"
18+
"val3":
19+
"type": "double"
2020

2121
- do:
2222
indices.create:
@@ -28,91 +28,76 @@ setup:
2828
- do:
2929
index:
3030
index: test
31-
type: test
3231
id: 1
3332
body: { "val1": 1.9, "val2": 3.1, "val3": 2.3 }
3433
- do:
3534
index:
3635
index: test
37-
type: test
3836
id: 2
3937
body: { "val1": -5.2, "val2": -3.4, "val3": 2.3}
4038
- do:
4139
index:
4240
index: test
43-
type: test
4441
id: 3
4542
body: { "val1": -5.2, "val3": 2.3}
4643
- do:
4744
index:
4845
index: test
49-
type: test
5046
id: 4
5147
body: { "val1": 18.3, "val2": 104.4, "val3": 2.3}
5248
- do:
5349
index:
5450
index: test
55-
type: test
5651
id: 5
5752
body: { "val1": -53.2, "val2": -322.4, "val3": 2.3}
5853
- do:
5954
index:
6055
index: test
61-
type: test
6256
id: 6
6357
body: { "val1": -578.9, "val2": 69.9, "val3": 2.3}
6458
- do:
6559
index:
6660
index: test
67-
type: test
6861
id: 7
6962
body: { "val1": 16.2, "val2": 17.2, "val3": 2.3}
7063
- do:
7164
index:
7265
index: test
73-
type: test
7466
id: 8
7567
body: { "val1": -4222.63, "val2": 316.44, "val3": 2.3}
7668
- do:
7769
index:
7870
index: test
79-
type: test
8071
id: 9
8172
body: { "val1": -59999.55, "val2": -3163.4, "val3": 2.3}
8273
- do:
8374
index:
8475
index: test
85-
type: test
8676
id: 10
8777
body: { "val1": 782.7, "val2": 789.7, "val3": 2.3}
8878
- do:
8979
index:
9080
index: test
91-
type: test
9281
id: 11
9382
body: { "val1": -1.2, "val2": 6.3, "val3": 2.3}
9483
- do:
9584
index:
9685
index: test
97-
type: test
9886
id: 12
9987
body: { "val1": 0, "val2": 1.11, "val3": 2.3}
10088
- do:
10189
index:
10290
index: test
103-
type: test
10491
id: 13
10592
body: { "val1": 0.1, "val2": 0.92, "val3": 2.3}
10693
- do:
10794
index:
10895
index: test
109-
type: test
11096
id: 14
11197
body: { "val1": 0.12, "val2": -82.4, "val3": 2.3}
11298
- do:
11399
index:
114100
index: test
115-
type: test
116101
id: 15
117102
body: { "val1": 98.2, "val2": 32.4, "val3": 2.3}
118103

modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/40_multi_value_field.yml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ setup:
33

44
- do:
55
indices.create:
6+
include_type_name: false
67
index: test
78
body:
89
settings:
910
number_of_shards: 3
1011
number_of_routing_shards: 3
1112
mappings:
12-
test:
13-
"properties":
14-
"val1":
15-
"type": "double"
16-
"val2":
17-
"type": "double"
18-
"val3":
19-
"type": "double"
13+
"properties":
14+
"val1":
15+
"type": "double"
16+
"val2":
17+
"type": "double"
18+
"val3":
19+
"type": "double"
2020

2121
- do:
2222
indices.create:
@@ -28,91 +28,76 @@ setup:
2828
- do:
2929
index:
3030
index: test
31-
type: test
3231
id: 1
3332
body: { "val1": 1.9, "val2": 3.1, "val3": 2.3, "vals" : [1.9, 16.143] }
3433
- do:
3534
index:
3635
index: test
37-
type: test
3836
id: 2
3937
body: { "val1": -5.2, "val2": -3.4, "val3": 2.3, "vals" : [155, 16.23]}
4038
- do:
4139
index:
4240
index: test
43-
type: test
4441
id: 3
4542
body: { "val1": -5.2, "val3": 2.3, "vals" : [-455, -32.32]}
4643
- do:
4744
index:
4845
index: test
49-
type: test
5046
id: 4
5147
body: { "val1": 18.3, "val2": 104.4, "val3": 2.3, "vals" : [0.14, 92.1]}
5248
- do:
5349
index:
5450
index: test
55-
type: test
5651
id: 5
5752
body: { "val1": -53.2, "val2": -322.4, "val3": 2.3, "vals" : [16, 16]}
5853
- do:
5954
index:
6055
index: test
61-
type: test
6256
id: 6
6357
body: { "val1": -578.9, "val2": 69.9, "val3": 2.3}
6458
- do:
6559
index:
6660
index: test
67-
type: test
6861
id: 7
6962
body: { "val1": 16.2, "val2": 17.2, "val3": 2.3, "vals" : [1234.3, -3433]}
7063
- do:
7164
index:
7265
index: test
73-
type: test
7466
id: 8
7567
body: { "val1": -4222.63, "val2": 316.44, "val3": 2.3, "vals" : [177.2, -93.333]}
7668
- do:
7769
index:
7870
index: test
79-
type: test
8071
id: 9
8172
body: { "val1": -59999.55, "val2": -3163.4, "val3": 2.3, "vals" : [-29.9, 163.0]}
8273
- do:
8374
index:
8475
index: test
85-
type: test
8676
id: 10
8777
body: { "val1": 782.7, "val2": 789.7, "val3": 2.3, "vals" : [-0.2, 1343.3]}
8878
- do:
8979
index:
9080
index: test
91-
type: test
9281
id: 11
9382
body: { "val1": -1.2, "val2": 6.3, "val3": 2.3, "vals" : [15.3, 16.9]}
9483
- do:
9584
index:
9685
index: test
97-
type: test
9886
id: 12
9987
body: { "val1": 0, "val2": 1.11, "val3": 2.3, "vals" : [-644.4, -644.4]}
10088
- do:
10189
index:
10290
index: test
103-
type: test
10491
id: 13
10592
body: { "val1": 0.1, "val2": 0.92, "val3": 2.3, "vals" : [73.2, 0.12]}
10693
- do:
10794
index:
10895
index: test
109-
type: test
11096
id: 14
11197
body: { "val1": 0.12, "val2": -82.4, "val3": 2.3, "vals" : [-0.001, 1295.3]}
11298
- do:
11399
index:
114100
index: test
115-
type: test
116101
id: 15
117102
body: { "val1": 98.2, "val2": 32.4, "val3": 2.3, "vals" : [15.5, 16.5]}
118103

modules/analysis-common/src/test/resources/rest-api-spec/test/indices.analyze/10_analyze.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
- do:
2525
indices.create:
26+
include_type_name: false
2627
index: test_deprecated_htmlstrip
2728
body:
2829
settings:
@@ -33,18 +34,16 @@
3334
tokenizer: keyword
3435
char_filter: ["htmlStrip"]
3536
mappings:
36-
type:
37-
properties:
38-
name:
39-
type: text
40-
analyzer: my_htmlStripWithCharfilter
37+
properties:
38+
name:
39+
type: text
40+
analyzer: my_htmlStripWithCharfilter
4141

4242
- do:
4343
warnings:
4444
- 'The [htmpStrip] char filter name is deprecated and will be removed in a future version. Please change the filter name to [html_strip] instead.'
4545
index:
4646
index: test_deprecated_htmlstrip
47-
type: type
4847
id: 1
4948
body: { "name": "foo bar" }
5049

@@ -53,7 +52,6 @@
5352
- 'The [htmpStrip] char filter name is deprecated and will be removed in a future version. Please change the filter name to [html_strip] instead.'
5453
index:
5554
index: test_deprecated_htmlstrip
56-
type: type
5755
id: 2
5856
body: { "name": "foo baz" }
5957

modules/analysis-common/src/test/resources/rest-api-spec/test/indices/validate_query/10_synonyms.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"validate query with synonyms":
33
- do:
44
indices.create:
5+
include_type_name: false
56
index: test
67
body:
78
settings:
@@ -16,11 +17,10 @@
1617
tokenizer: standard
1718
filter: [ syns ]
1819
mappings:
19-
test:
20-
properties:
21-
field:
22-
type: text
23-
analyzer: syns
20+
properties:
21+
field:
22+
type: text
23+
analyzer: syns
2424

2525
- do:
2626
indices.validate_query:
@@ -77,6 +77,3 @@
7777
- is_true: valid
7878
- length: { explanations: 1 }
7979
- match: { explanations.0.explanation: "field:\"foo (one* two*)\"" }
80-
81-
82-

modules/analysis-common/src/test/resources/rest-api-spec/test/search.query/10_match.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# versions in the same position.
66
- do:
77
indices.create:
8+
include_type_name: false
89
index: test
910
body:
1011
settings:
@@ -24,17 +25,15 @@
2425
type: unique
2526
only_on_same_position: true
2627
mappings:
27-
doc:
28-
properties:
29-
text:
30-
type: text
31-
analyzer: index
32-
search_analyzer: search
28+
properties:
29+
text:
30+
type: text
31+
analyzer: index
32+
search_analyzer: search
3333

3434
- do:
3535
index:
3636
index: test
37-
type: doc
3837
id: 1
3938
body: { "text": "the fox runs across the street" }
4039
refresh: true
@@ -53,7 +52,6 @@
5352
- do:
5453
index:
5554
index: test
56-
type: doc
5755
id: 2
5856
body: { "text": "run fox run" }
5957
refresh: true

0 commit comments

Comments
 (0)