Skip to content

Commit bfdc33f

Browse files
committed
Adjust the REST tests to account for different versions.
1 parent e2fdad9 commit bfdc33f

File tree

10 files changed

+45
-37
lines changed

10 files changed

+45
-37
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Create index with mappings":
33
- skip:
44
version: " - 6.6.99"
5-
reason: include_type_name was introduced in 6.7
5+
reason: include_type_name was introduced in 6.7.0
66
- do:
77
indices.create:
88
include_type_name: false
@@ -22,7 +22,7 @@
2222
"Create index with settings":
2323
- skip:
2424
version: " - 6.6.99"
25-
reason: include_type_name was introduced in 6.7
25+
reason: include_type_name was introduced in 6.7.0
2626
- do:
2727
indices.create:
2828
include_type_name: false
@@ -41,7 +41,7 @@
4141
"Create index":
4242
- skip:
4343
version: " - 6.6.99"
44-
reason: include_type_name was introduced in 6.7
44+
reason: include_type_name was introduced in 6.7.0
4545
- do:
4646
indices.create:
4747
include_type_name: false
@@ -54,7 +54,7 @@
5454
"Create index with wait_for_active_shards set to all":
5555
- skip:
5656
version: " - 6.6.99"
57-
reason: include_type_name was introduced in 6.7
57+
reason: include_type_name was introduced in 6.7.0
5858
- do:
5959
indices.create:
6060
include_type_name: false
@@ -71,7 +71,7 @@
7171
"Create index with aliases":
7272
- skip:
7373
version: " - 6.6.99"
74-
reason: include_type_name was introduced in 6.7
74+
reason: include_type_name was introduced in 6.7.0
7575
- do:
7676
indices.create:
7777
include_type_name: false

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
setup:
33
- skip:
4-
version: " - 6.99.99"
5-
reason: include_type_name is not supported before 7.0.0
4+
version: " - 6.6.99"
5+
reason: include_type_name was introduced in 6.7.0
66
- do:
77
indices.create:
88
include_type_name: false

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_field_mapping/60_mix_typeless_typeful.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
- skip:
55
version: " - 6.99.99"
6-
reason: include_type_name was introduced in 7.0.0
6+
reason: include_type_name was introduced in 6.7.0
77

88
- do:
99
indices.create: # not using include_type_name: false on purpose

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
setup:
33
- skip:
44
version: " - 6.6.99"
5-
reason: include_type_name was introduced in 6.7
5+
reason: include_type_name was introduced in 6.7.0
66
- do:
77
indices.create:
88
include_type_name: false

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
setup:
22
- skip:
3-
version: " - 6.99.99"
4-
reason: include_type_name is not supported before 7.0.0
3+
version: " - 6.6.99"
4+
reason: include_type_name was introduced in 6.7
55
- do:
66
indices.put_template:
77
name: test
@@ -34,6 +34,9 @@ setup:
3434

3535
---
3636
"Get template with no mappings":
37+
- skip:
38+
version: " - 5.99.99"
39+
reason: this uses a new API that has been added in 6.0
3740

3841
- do:
3942
indices.put_template:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_template/11_basic_with_types.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,29 @@ setup:
88
number_of_shards: 1
99
number_of_replicas: 0
1010
mappings:
11-
_doc:
11+
doc:
1212
properties:
1313
field:
1414
type: keyword
1515

1616
---
1717
"Get template":
18-
18+
- skip:
19+
version: " - 5.99.99"
20+
reason: this uses a new API that has been added in 6.0
1921
- do:
2022
indices.get_template:
2123
name: test
2224

2325
- match: {test.index_patterns: ["test-*"]}
2426
- match: {test.settings: {index: {number_of_shards: '1', number_of_replicas: '0'}}}
25-
- match: {test.mappings: {_doc: {properties: {field: {type: keyword}}}}}
27+
- match: {test.mappings: {doc: {properties: {field: {type: keyword}}}}}
2628

2729
---
2830
"Get template with no mappings":
29-
31+
- skip:
32+
version: " - 5.99.99"
33+
reason: this uses a new API that has been added in 6.0
3034
- do:
3135
indices.put_template:
3236
name: test_no_mappings

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Test Create and update mapping":
33
- skip:
44
version: " - 6.6.99"
5-
reason: include_type_name was introduced in 6.7
5+
reason: include_type_name was introduced in 6.7.0
66
- do:
77
indices.create:
88
include_type_name: false
@@ -60,7 +60,7 @@
6060
"Create index with invalid mappings":
6161
- skip:
6262
version: " - 6.6.99"
63-
reason: include_type_name was introduced in 6.7
63+
reason: include_type_name was introduced in 6.7.0
6464
- do:
6565
indices.create:
6666
include_type_name: false
@@ -79,7 +79,7 @@
7979
"PUT mapping with a type and include_type_name: false":
8080
- skip:
8181
version: " - 6.6.99"
82-
reason: include_type_name was introduced in 6.7
82+
reason: include_type_name was introduced in 6.7.0
8383
- do:
8484
indices.create:
8585
index: index

rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
setup:
22
- skip:
33
version: " - 6.6.99"
4-
reason: include_type_name was introduced in 6.7
4+
reason: include_type_name was introduced in 6.7.0
55
- do:
66
indices.create:
77
include_type_name: false

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

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
---
22
"Put template":
33
- skip:
4-
version: " - 6.99.99"
5-
reason: include_type_name is not supported before 7.0.0
6-
7-
- skip:
8-
version: " - 5.99.99"
9-
reason: this uses a new API that has been added in 6.0
4+
version: " - 6.6.99"
5+
reason: include_type_name was introduced in 6.7
106

117
- do:
128
indices.put_template:
@@ -35,12 +31,8 @@
3531
---
3632
"Put multiple template":
3733
- skip:
38-
version: " - 6.99.99"
39-
reason: include_type_name was introduced in 7.0.0
40-
41-
- skip:
42-
version: " - 5.99.99"
43-
reason: this uses a new API that has been added in 6.0
34+
version: " - 6.6.99"
35+
reason: include_type_name was introduced in 6.7
4436

4537
- do:
4638
indices.put_template:
@@ -69,8 +61,8 @@
6961
---
7062
"Put template with empty mappings":
7163
- skip:
72-
version: " - 6.99.99"
73-
reason: include_type_name was introduced in 7.0.0
64+
version: " - 6.6.99"
65+
reason: include_type_name was introduced in 6.7
7466

7567
- do:
7668
indices.put_template:

rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_template/11_basic_with_types.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
"Put template":
3+
- skip:
4+
version: " - 5.99.99"
5+
reason: this uses a new API that has been added in 6.0
36
- do:
47
indices.put_template:
58
name: test
@@ -9,7 +12,7 @@
912
number_of_shards: 1
1013
number_of_replicas: 0
1114
mappings:
12-
_doc:
15+
doc:
1316
properties:
1417
field:
1518
type: keyword
@@ -21,10 +24,13 @@
2124

2225
- match: {test.index_patterns: ["test-*"]}
2326
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
24-
- match: {test.mappings: {_doc: {properties: {field: {type: keyword}}}}}
27+
- match: {test.mappings: {doc: {properties: {field: {type: keyword}}}}}
2528

2629
---
2730
"Put multiple template":
31+
- skip:
32+
version: " - 5.99.99"
33+
reason: this uses a new API that has been added in 6.0
2834
- do:
2935
indices.put_template:
3036
name: test
@@ -34,7 +40,7 @@
3440
number_of_shards: 1
3541
number_of_replicas: 0
3642
mappings:
37-
_doc:
43+
doc:
3844
properties:
3945
field:
4046
type: text
@@ -46,10 +52,13 @@
4652

4753
- match: {test.index_patterns: ["test-*", "test2-*"]}
4854
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
49-
- match: {test.mappings: {_doc: {properties: {field: {type: text}}}}}
55+
- match: {test.mappings: {doc: {properties: {field: {type: text}}}}}
5056

5157
---
5258
"Put template with empty mappings":
59+
- skip:
60+
version: " - 5.99.99"
61+
reason: this uses a new API that has been added in 6.0
5362
- do:
5463
indices.put_template:
5564
name: test

0 commit comments

Comments
 (0)