Skip to content

Commit

Permalink
Check specific metadata info
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdelest committed Jan 16, 2024
1 parent 4c45267 commit 028b29a
Showing 1 changed file with 98 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,11 @@
- match: { nodes.$node_id.indices.mappings.total_estimated_overhead_in_bytes: 0 }

---
"indices mappings count test for indices level":
"indices mappings exact count test for indices level":

- skip:
features: [arbitrary_key]
version: " - 8.4.99"
version: " - 8.4.99, 8.13.0 - "
reason: "mappings added in version 8.5.0"

- do:
Expand Down Expand Up @@ -502,9 +502,103 @@
- gte: { nodes.$node_id.indices.mappings.total_count: 26 }
- is_true: nodes.$node_id.indices.mappings.total_estimated_overhead
- gte: { nodes.$node_id.indices.mappings.total_estimated_overhead_in_bytes: 26624 }
- gte: { nodes.$node_id.indices.indices.index1.mappings.total_count: 26 }
- match: { nodes.$node_id.indices.indices.index1.mappings.total_count: 26 }
- is_true: nodes.$node_id.indices.indices.index1.mappings.total_estimated_overhead
- match: { nodes.$node_id.indices.indices.index1.mappings.total_estimated_overhead_in_bytes: 26624 }

---
"indices mappings exact count test for indices level for 8.13+":

- skip:
features: [arbitrary_key]
version: " - 8.12.99"
reason: "new metadata mapping added in version 8.13.0"

- do:
indices.create:
index: index1
body:
settings:
number_of_shards: 4
number_of_replicas: 0
mappings:
runtime:
a_source_field:
type: keyword
properties:
"@timestamp":
type: date
authors:
properties:
age:
type: long
company:
type: text
fields:
keyword:
type: keyword
ignore_above: 256
name:
properties:
first_name:
type: keyword
full_name:
type: text
last_name:
type: keyword
link:
type: alias
path: url
title:
type: text
url:
type: keyword

- do:
nodes.info: {}
- set:
nodes._arbitrary_key_: node_id

- do:
nodes.stats: { metric: _all, level: "indices", human: true }

# In the below assertions, we expect a field count of 26 because the above mapping expects the following:
# Field mappers (incl. alias fields and object mappers' flattened leaves):
# 1. _data_stream_timestamp
# 2. _doc_count
# 3. _feature
# 4. _field_names
# 5. _id
# 6. _ignored
# 7. _index
# 8. _nested_path
# 9. _routing
# 10. _seq_no
# 11. _source
# 12. _tier
# 13. _version
# 14. @timestamp
# 15. authors.age
# 16. authors.company
# 17. authors.company.keyword
# 18. authors.name.last_name
# 19. authors.name.first_name
# 20. authors.name.full_name
# 21. link
# 22. title
# 23. url
# Object mappers:
# 24. authors
# 25. authors.name
# Runtime field mappers:
# 26. a_source_field

- gte: { nodes.$node_id.indices.mappings.total_count: 27 }
- is_true: nodes.$node_id.indices.mappings.total_estimated_overhead
- gte: { nodes.$node_id.indices.mappings.total_estimated_overhead_in_bytes: 26624 }
- match: { nodes.$node_id.indices.indices.index1.mappings.total_count: 27 }
- is_true: nodes.$node_id.indices.indices.index1.mappings.total_estimated_overhead
- gte: { nodes.$node_id.indices.indices.index1.mappings.total_estimated_overhead_in_bytes: 26624 }
- match: { nodes.$node_id.indices.indices.index1.mappings.total_estimated_overhead_in_bytes: 26624 }

---
"indices mappings does not exist in shards level":
Expand Down

0 comments on commit 028b29a

Please sign in to comment.