Skip to content

Commit

Permalink
Removes typed calls from YAML REST tests (#37611)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
colings86 authored Jan 30, 2019
1 parent 2f7776c commit 21e392e
Show file tree
Hide file tree
Showing 245 changed files with 1,433 additions and 2,342 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@
"Empty Bucket Aggregation":
- do:
indices.create:
include_type_name: false
index: empty_bucket_idx
body:
settings:
number_of_shards: "3"
mappings:
test:
"properties":
"value":
"type": "integer"
"val1":
"type": "double"
"properties":
"value":
"type": "integer"
"val1":
"type": "double"

- do:
index:
index: empty_bucket_idx
type: test
id: 1
body: { "value": 0, "val1": 3.1 }

- do:
index:
index: empty_bucket_idx
type: test
id: 2
body: { "value": 2, "val1": -3.1 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ setup:

- do:
indices.create:
include_type_name: false
index: test
body:
settings:
number_of_shards: 3
number_of_routing_shards: 3
mappings:
test:
"properties":
"val1":
"type": "double"
"val2":
"type": "double"
"val3":
"type": "double"
"properties":
"val1":
"type": "double"
"val2":
"type": "double"
"val3":
"type": "double"

- do:
indices.create:
Expand All @@ -28,91 +28,76 @@ setup:
- do:
index:
index: test
type: test
id: 1
body: { "val1": 1.9, "val2": 3.1, "val3": 2.3 }
- do:
index:
index: test
type: test
id: 2
body: { "val1": -5.2, "val2": -3.4, "val3": 2.3}
- do:
index:
index: test
type: test
id: 3
body: { "val1": -5.2, "val3": 2.3}
- do:
index:
index: test
type: test
id: 4
body: { "val1": 18.3, "val2": 104.4, "val3": 2.3}
- do:
index:
index: test
type: test
id: 5
body: { "val1": -53.2, "val2": -322.4, "val3": 2.3}
- do:
index:
index: test
type: test
id: 6
body: { "val1": -578.9, "val2": 69.9, "val3": 2.3}
- do:
index:
index: test
type: test
id: 7
body: { "val1": 16.2, "val2": 17.2, "val3": 2.3}
- do:
index:
index: test
type: test
id: 8
body: { "val1": -4222.63, "val2": 316.44, "val3": 2.3}
- do:
index:
index: test
type: test
id: 9
body: { "val1": -59999.55, "val2": -3163.4, "val3": 2.3}
- do:
index:
index: test
type: test
id: 10
body: { "val1": 782.7, "val2": 789.7, "val3": 2.3}
- do:
index:
index: test
type: test
id: 11
body: { "val1": -1.2, "val2": 6.3, "val3": 2.3}
- do:
index:
index: test
type: test
id: 12
body: { "val1": 0, "val2": 1.11, "val3": 2.3}
- do:
index:
index: test
type: test
id: 13
body: { "val1": 0.1, "val2": 0.92, "val3": 2.3}
- do:
index:
index: test
type: test
id: 14
body: { "val1": 0.12, "val2": -82.4, "val3": 2.3}
- do:
index:
index: test
type: test
id: 15
body: { "val1": 98.2, "val2": 32.4, "val3": 2.3}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ setup:

- do:
indices.create:
include_type_name: false
index: test
body:
settings:
number_of_shards: 3
number_of_routing_shards: 3
mappings:
test:
"properties":
"val1":
"type": "double"
"val2":
"type": "double"
"val3":
"type": "double"
"properties":
"val1":
"type": "double"
"val2":
"type": "double"
"val3":
"type": "double"

- do:
indices.create:
Expand All @@ -28,91 +28,76 @@ setup:
- do:
index:
index: test
type: test
id: 1
body: { "val1": 1.9, "val2": 3.1, "val3": 2.3, "vals" : [1.9, 16.143] }
- do:
index:
index: test
type: test
id: 2
body: { "val1": -5.2, "val2": -3.4, "val3": 2.3, "vals" : [155, 16.23]}
- do:
index:
index: test
type: test
id: 3
body: { "val1": -5.2, "val3": 2.3, "vals" : [-455, -32.32]}
- do:
index:
index: test
type: test
id: 4
body: { "val1": 18.3, "val2": 104.4, "val3": 2.3, "vals" : [0.14, 92.1]}
- do:
index:
index: test
type: test
id: 5
body: { "val1": -53.2, "val2": -322.4, "val3": 2.3, "vals" : [16, 16]}
- do:
index:
index: test
type: test
id: 6
body: { "val1": -578.9, "val2": 69.9, "val3": 2.3}
- do:
index:
index: test
type: test
id: 7
body: { "val1": 16.2, "val2": 17.2, "val3": 2.3, "vals" : [1234.3, -3433]}
- do:
index:
index: test
type: test
id: 8
body: { "val1": -4222.63, "val2": 316.44, "val3": 2.3, "vals" : [177.2, -93.333]}
- do:
index:
index: test
type: test
id: 9
body: { "val1": -59999.55, "val2": -3163.4, "val3": 2.3, "vals" : [-29.9, 163.0]}
- do:
index:
index: test
type: test
id: 10
body: { "val1": 782.7, "val2": 789.7, "val3": 2.3, "vals" : [-0.2, 1343.3]}
- do:
index:
index: test
type: test
id: 11
body: { "val1": -1.2, "val2": 6.3, "val3": 2.3, "vals" : [15.3, 16.9]}
- do:
index:
index: test
type: test
id: 12
body: { "val1": 0, "val2": 1.11, "val3": 2.3, "vals" : [-644.4, -644.4]}
- do:
index:
index: test
type: test
id: 13
body: { "val1": 0.1, "val2": 0.92, "val3": 2.3, "vals" : [73.2, 0.12]}
- do:
index:
index: test
type: test
id: 14
body: { "val1": 0.12, "val2": -82.4, "val3": 2.3, "vals" : [-0.001, 1295.3]}
- do:
index:
index: test
type: test
id: 15
body: { "val1": 98.2, "val2": 32.4, "val3": 2.3, "vals" : [15.5, 16.5]}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

- do:
indices.create:
include_type_name: false
index: test_deprecated_htmlstrip
body:
settings:
Expand All @@ -33,18 +34,16 @@
tokenizer: keyword
char_filter: ["htmlStrip"]
mappings:
type:
properties:
name:
type: text
analyzer: my_htmlStripWithCharfilter
properties:
name:
type: text
analyzer: my_htmlStripWithCharfilter

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"validate query with synonyms":
- do:
indices.create:
include_type_name: false
index: test
body:
settings:
Expand All @@ -16,11 +17,10 @@
tokenizer: standard
filter: [ syns ]
mappings:
test:
properties:
field:
type: text
analyzer: syns
properties:
field:
type: text
analyzer: syns

- do:
indices.validate_query:
Expand Down Expand Up @@ -77,6 +77,3 @@
- is_true: valid
- length: { explanations: 1 }
- match: { explanations.0.explanation: "field:\"foo (one* two*)\"" }



Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# versions in the same position.
- do:
indices.create:
include_type_name: false
index: test
body:
settings:
Expand All @@ -24,17 +25,15 @@
type: unique
only_on_same_position: true
mappings:
doc:
properties:
text:
type: text
analyzer: index
search_analyzer: search
properties:
text:
type: text
analyzer: index
search_analyzer: search

- do:
index:
index: test
type: doc
id: 1
body: { "text": "the fox runs across the street" }
refresh: true
Expand All @@ -53,7 +52,6 @@
- do:
index:
index: test
type: doc
id: 2
body: { "text": "run fox run" }
refresh: true
Expand Down
Loading

0 comments on commit 21e392e

Please sign in to comment.