Skip to content

Commit 994c3c6

Browse files
authored
[7.17] [Testing] Enable bwc and fix sorting for 500_date_range (#90681) (#90689)
the #90458 has been backported to all branches so the bwc testing can be enable for this tests were incorrectly relying on sort order. Added sort to make it deterministic closes #90668
1 parent 75df484 commit 994c3c6

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/500_date_range.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
setup:
22
- skip:
3-
version: " - 8.5.99"
4-
reason: awaits backports
3+
version: " - 7.17.6"
4+
reason: fixed in 7.17.7
55
- do:
66
indices.create:
77
index: dates_year_only
@@ -16,14 +16,14 @@ setup:
1616
bulk:
1717
refresh: true
1818
body:
19-
- '{ "index" : { "_index" : "dates_year_only", "_id" : "first" } }'
19+
- '{ "index" : { "_index" : "dates_year_only", "_id" : "1" } }'
2020
- '{"date" : "1900", "field" : 1 }'
21-
- '{ "index" : { "_index" : "dates_year_only", "_id" : "second" } }'
22-
- '{"date" : "2022", "field" : 1 }'
23-
- '{ "index" : { "_index" : "dates_year_only", "_id" : "third" } }'
21+
- '{ "index" : { "_index" : "dates_year_only", "_id" : "2" } }'
2422
- '{"date" : "2022", "field" : 2 }'
25-
- '{ "index" : { "_index" : "dates_year_only", "_id" : "fourth" } }'
26-
- '{"date" : "1500", "field" : 2 }'
23+
- '{ "index" : { "_index" : "dates_year_only", "_id" : "3" } }'
24+
- '{"date" : "2022", "field" : 3 }'
25+
- '{ "index" : { "_index" : "dates_year_only", "_id" : "4" } }'
26+
- '{"date" : "1500", "field" : 4 }'
2727

2828
- do:
2929
indices.create:
@@ -38,16 +38,16 @@ setup:
3838
bulk:
3939
refresh: true
4040
body:
41-
- '{ "index" : { "_index" : "dates", "_id" : "first" } }'
41+
- '{ "index" : { "_index" : "dates", "_id" : "1" } }'
4242
- '{"date" : "1900-01-01T12:12:12.123456789Z", "field" : 1 }'
43-
- '{ "index" : { "_index" : "dates", "_id" : "second" } }'
44-
- '{"date" : "2022-01-01T12:12:12.123456789Z", "field" : 1 }'
45-
- '{ "index" : { "_index" : "dates", "_id" : "third" } }'
46-
- '{"date" : "2022-01-03T12:12:12.123456789Z", "field" : 2 }'
47-
- '{ "index" : { "_index" : "dates", "_id" : "fourth" } }'
48-
- '{"date" : "1500-01-01T12:12:12.123456789Z", "field" : 2 }'
49-
- '{ "index" : { "_index" : "dates", "_id" : "fifth" } }'
50-
- '{"date" : "1500-01-05T12:12:12.123456789Z", "field" : 2 }'
43+
- '{ "index" : { "_index" : "dates", "_id" : "2" } }'
44+
- '{"date" : "2022-01-01T12:12:12.123456789Z", "field" : 2 }'
45+
- '{ "index" : { "_index" : "dates", "_id" : "3" } }'
46+
- '{"date" : "2022-01-03T12:12:12.123456789Z", "field" : 3 }'
47+
- '{ "index" : { "_index" : "dates", "_id" : "4" } }'
48+
- '{"date" : "1500-01-01T12:12:12.123456789Z", "field" : 4 }'
49+
- '{ "index" : { "_index" : "dates", "_id" : "5" } }'
50+
- '{"date" : "1500-01-05T12:12:12.123456789Z", "field" : 5 }'
5151

5252
---
5353
"test range query for all docs with year uuuu":
@@ -56,6 +56,7 @@ setup:
5656
rest_total_hits_as_int: true
5757
index: dates
5858
body:
59+
sort: field
5960
query:
6061
range:
6162
date:
@@ -73,6 +74,7 @@ setup:
7374
rest_total_hits_as_int: true
7475
index: dates
7576
body:
77+
sort: field
7678
query:
7779
range:
7880
date:
@@ -82,7 +84,7 @@ setup:
8284

8385
- match: { hits.total: 1 }
8486
- length: { hits.hits: 1 }
85-
- match: { hits.hits.0._id: "fourth" }
87+
- match: { hits.hits.0._id: "4" }
8688

8789
---
8890
"test match query gte and lte with year uuuu":
@@ -91,6 +93,7 @@ setup:
9193
rest_total_hits_as_int: true
9294
index: dates
9395
body:
96+
sort: field
9497
query:
9598
range:
9699
date:
@@ -100,9 +103,9 @@ setup:
100103

101104
- match: { hits.total: 3 }
102105
- length: { hits.hits: 3 }
103-
- match: { hits.hits.0._id: "first" }
104-
- match: { hits.hits.1._id: "fourth" }
105-
- match: { hits.hits.2._id: "fifth" }
106+
- match: { hits.hits.0._id: "1" }
107+
- match: { hits.hits.1._id: "4" }
108+
- match: { hits.hits.2._id: "5" }
106109

107110
---
108111
"test match query with year uuuu":
@@ -111,11 +114,12 @@ setup:
111114
rest_total_hits_as_int: true
112115
index: dates_year_only
113116
body:
117+
sort: field
114118
query:
115119
match:
116120
date:
117121
query: "1500"
118122

119123
- match: { hits.total: 1 }
120124
- length: { hits.hits: 1 }
121-
- match: { hits.hits.0._id: "fourth" }
125+
- match: { hits.hits.0._id: "4" }

0 commit comments

Comments
 (0)