Skip to content

Commit bf8ef51

Browse files
authored
[8.14] Extend the Health API basic YAML tests (#108811) (#109111)
* Extend the Health API basic YAML tests (#108811) The health node might not have received the health info from all nodes yet before the execution of this test, resulting in an "unknown" status. We make the status assertion more lenient to allow for this uncertainty. Additionally, we add some more assertions for the basic response structure of the other indicators. * Merge and bump Health API YAML tests (#109009)
1 parent 7e1c858 commit bf8ef51

File tree

5 files changed

+72
-7
lines changed

5 files changed

+72
-7
lines changed
Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,45 @@
11
---
22
"cluster health basic test":
33
- skip:
4-
version: "- 8.6.99"
5-
reason: "health was added in 8.2.0, master_is_stable in 8.4.0, and REST API updated in 8.7"
4+
version: "- 8.12.99"
5+
reason: "data stream lifecycle indicator was added in 8.13.0"
66

77
- do:
88
health_report: { }
99

1010
- is_true: cluster_name
11-
- match: { status: "green" }
12-
- match: { indicators.master_is_stable.status: "green" }
13-
- match: { indicators.master_is_stable.symptom: "The cluster has a stable master node" }
11+
# This test might execute before the health node has received all health info, resulting in status "unknown"
12+
- is_true: status
13+
- match: { indicators.master_is_stable.status: "green" }
14+
- match: { indicators.master_is_stable.symptom: "The cluster has a stable master node" }
15+
- is_true: indicators.master_is_stable.details.current_master.node_id
16+
- is_true: indicators.master_is_stable.details.current_master.name
17+
- is_true: indicators.master_is_stable.details.recent_masters.0.node_id
18+
- is_true: indicators.master_is_stable.details.recent_masters.0.name
19+
20+
- match: { indicators.repository_integrity.status: "green" }
21+
- match: { indicators.repository_integrity.symptom: "No snapshot repositories configured." }
22+
23+
- is_true: indicators.disk.status
24+
- is_true: indicators.disk.symptom
25+
26+
- match: { indicators.shards_availability.status: "green" }
27+
- match: { indicators.shards_availability.symptom: "This cluster has all shards available." }
28+
- exists: indicators.shards_availability.details.initializing_replicas
29+
- exists: indicators.shards_availability.details.creating_primaries
30+
- exists: indicators.shards_availability.details.restarting_replicas
31+
- exists: indicators.shards_availability.details.unassigned_primaries
32+
- exists: indicators.shards_availability.details.started_replicas
33+
- exists: indicators.shards_availability.details.creating_replicas
34+
- exists: indicators.shards_availability.details.initializing_primaries
35+
- exists: indicators.shards_availability.details.restarting_primaries
36+
- exists: indicators.shards_availability.details.started_primaries
37+
- exists: indicators.shards_availability.details.unassigned_replicas
38+
39+
- match: { indicators.shards_capacity.status: "green" }
40+
- match: { indicators.shards_capacity.symptom: "The cluster has enough room to add new shards." }
41+
- is_true: indicators.shards_capacity.details.data.max_shards_in_cluster
42+
- is_true: indicators.shards_capacity.details.frozen.max_shards_in_cluster
43+
44+
- is_true: indicators.data_stream_lifecycle.status
45+
- is_true: indicators.data_stream_lifecycle.symptom

x-pack/plugin/ilm/qa/rest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88

99
restResources {
1010
restApi {
11-
include '_common', 'cluster', 'indices', 'index', 'snapshot', 'ilm', 'slm'
11+
include '_common', 'cluster', 'indices', 'index', 'snapshot', 'ilm', 'slm', 'health_report'
1212
}
1313
}
1414

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"basic ILM health indicator test":
3+
- requires:
4+
cluster_features: "gte_v8.7.0"
5+
reason: "health was added in 8.2.0, master_is_stable in 8.4.0, and REST API updated in 8.7"
6+
7+
- do:
8+
health_report: { }
9+
10+
- is_true: cluster_name
11+
# This test might execute before the health node has received all health info, resulting in status "unknown"
12+
- is_true: status
13+
- match: { indicators.ilm.status: "green" }
14+
- match: { indicators.ilm.symptom: "Index Lifecycle Management is running" }
15+
- match: { indicators.ilm.details.ilm_status: "RUNNING" }
16+
- is_true: indicators.ilm.details.policies
17+
- exists: indicators.ilm.details.stagnating_indices

x-pack/plugin/slm/qa/rest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88

99
restResources {
1010
restApi {
11-
include '_common', 'cluster', 'indices', 'index', 'snapshot', 'slm'
11+
include '_common', 'cluster', 'indices', 'index', 'snapshot', 'slm', 'health_report'
1212
}
1313
}
1414

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"basic SLM health indicator test":
3+
- requires:
4+
cluster_features: "gte_v8.7.0"
5+
reason: "health was added in 8.2.0, master_is_stable in 8.4.0, and REST API updated in 8.7"
6+
7+
- do:
8+
health_report: { }
9+
10+
- is_true: cluster_name
11+
# This test might execute before the health node has received all health info, resulting in status "unknown"
12+
- is_true: status
13+
- match: { indicators.slm.status: "green" }
14+
- match: { indicators.slm.symptom: "No Snapshot Lifecycle Management policies configured" }
15+
- match: { indicators.slm.details.slm_status: "RUNNING" }
16+
- exists: indicators.slm.details.policies

0 commit comments

Comments
 (0)