Skip to content

Commit

Permalink
Updated Date Range to Follow Documentation When Assuming Missing Valu…
Browse files Browse the repository at this point in the history
…es - Remove Vestigial Date Range Test (#113976)

* removing date range test as it impacts nothing

* removing date range test as it impacts nothing

* removing date range test as it impacts nothing -- revert
  • Loading branch information
john-wagster authored Oct 2, 2024
1 parent e861267 commit ad802de
Showing 1 changed file with 0 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,140 +525,6 @@ setup:
_source:
ip_range: { "gte": "2001:db8::", "lte": null }

---
"Date range":
- skip:
cluster_features: ["mapper.range.date_range_indexing_fix"]
reason: "tests prior to rounding fixes in 8.16.0 that caused non-intuitive indexing and query because ranges were assumed to always index with 0's as the default such as when time is missing 00:00:00.000 time was assumed but for lte indexing and query missing time should be 23:59:59.999 as per docs here: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html"

- do:
index:
index: synthetic_source_test
id: "1"
body: { "date_range" : { "gte": "2017-09-01", "lte": "2017-09-05" } }

- do:
index:
index: synthetic_source_test
id: "2"
body: { "date_range" : { "gt": "2017-09-01", "lte": "2017-09-03" } }

- do:
index:
index: synthetic_source_test
id: "3"
body: { "date_range" : [ { "gte": "2017-09-04", "lt": "2017-09-05" } ] }

- do:
index:
index: synthetic_source_test
id: "4"
body: { "date_range" : [ { "gt": "2017-09-04", "lt": "2017-09-08" }, { "gt": "2017-09-04", "lt": "2017-09-07" } ] }

- do:
index:
index: synthetic_source_test
id: "5"
body: { "date_range" : { "gte": 1504224000000, "lte": 1504569600000 } }

- do:
index:
index: synthetic_source_test
id: "6"
body: { "date_range" : { "gte": "2017-09-01T10:20:30.123Z", "lte": "2017-09-05T03:04:05.789Z" } }

- do:
index:
index: synthetic_source_test
id: "7"
body: { "date_range" : null }

- do:
index:
index: synthetic_source_test
id: "8"
body: { "date_range": { "gte": null, "lte": "2017-09-05" } }

- do:
index:
index: synthetic_source_test
id: "9"
body: { "date_range": { "gte": "2017-09-05" } }

- do:
indices.refresh: {}

- do:
get:
index: synthetic_source_test
id: "1"
- match:
_source:
date_range: { "gte": "2017-09-01T00:00:00.000Z", "lte": "2017-09-05T00:00:00.000Z" }

- do:
get:
index: synthetic_source_test
id: "2"
- match:
_source:
date_range: { "gte": "2017-09-01T00:00:00.001Z", "lte": "2017-09-03T00:00:00.000Z" }

- do:
get:
index: synthetic_source_test
id: "3"
- match:
_source:
date_range: { "gte": "2017-09-04T00:00:00.000Z", "lte": "2017-09-04T23:59:59.999Z" }

- do:
get:
index: synthetic_source_test
id: "4"
- match:
_source:
date_range: [ { "gte": "2017-09-04T00:00:00.001Z", "lte": "2017-09-06T23:59:59.999Z" }, { "gte": "2017-09-04T00:00:00.001Z", "lte": "2017-09-07T23:59:59.999Z" } ]

- do:
get:
index: synthetic_source_test
id: "5"
- match:
_source:
date_range: { "gte": "2017-09-01T00:00:00.000Z", "lte": "2017-09-05T00:00:00.000Z" }

- do:
get:
index: synthetic_source_test
id: "6"
- match:
_source:
date_range: { "gte": "2017-09-01T10:20:30.123Z", "lte": "2017-09-05T03:04:05.789Z" }

- do:
get:
index: synthetic_source_test
id: "7"
- match:
_source: {}

- do:
get:
index: synthetic_source_test
id: "8"
- match:
_source:
date_range: { "gte": null, "lte": "2017-09-05T00:00:00.000Z" }

- do:
get:
index: synthetic_source_test
id: "9"
- match:
_source:
date_range: { "gte": "2017-09-05T00:00:00.000Z", "lte": null }

---
"Date range Rounding Fixes":
- requires:
Expand Down

0 comments on commit ad802de

Please sign in to comment.