Skip to content

Commit a3ee87f

Browse files
committed
enhancement: add monitoring test to check targets are up and running
1 parent 4d10c7f commit a3ee87f

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

ods_ci/tests/Resources/Page/ODH/Prometheus/Prometheus.robot

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,22 @@ Wait Until Alert Is Not Firing # robocop: disable:too-many-arguments
244244
Wait Until Keyword Succeeds ${timeout} 30s
245245
... Alert Should Not Be Firing ${pm_url} ${pm_token} ${rule_group} ${alert} ${alert-duration}
246246

247+
Get Target Pools
248+
[Documentation] Returns list of Targets scrape pools
249+
[Arguments] ${pm_url} ${pm_token} ${username} ${password}
250+
${links}= Run curl --silent -X GET -H "Authorization:Bearer ${pm_token}" -u ${username}:${password} -k ${pm_url}/api/v1/targets | jq '.data.activeTargets[] | .scrapePool' #robocop:disable
251+
${links}= Replace String ${links} " ${EMPTY}
252+
@{links}= Split String ${links} \n
253+
RETURN ${links}
254+
255+
Get Target Pools Which Have State Up
256+
[Documentation] Returns list of Targets scrape pools which have state as "UP"
257+
[Arguments] ${pm_url} ${pm_token} ${username} ${password}
258+
${links}= Run curl --silent -X GET -H "Authorization:Bearer ${pm_token}" -u ${username}:${password} -k ${pm_url}/api/v1/targets | jq '.data.activeTargets[] | select(.health == "up") | .scrapePool' #robocop:disable
259+
${links}= Replace String ${links} " ${EMPTY}
260+
@{links}= Split String ${links} \n
261+
RETURN ${links}
262+
247263
Get Target Endpoints
248264
[Documentation] Returns list of Endpoint URLs
249265
[Arguments] ${target_name} ${pm_url} ${pm_token} ${username} ${password}

ods_ci/tests/Tests/0100__platform/0102__monitor_and_manage/0101__metrics/0101__metrics.robot

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,36 @@ Test Metric Existence For "Rhods_Aggregate_Availability" On ODS Prometheus
9494
Should Contain ${list_values} ${resp.json()["data"]["result"][0]["value"][-1]}
9595

9696

97+
Test Targets Are Available And Up In RHOAI Prometheus
98+
[Documentation] Verifies the expected targets in Prometheus are available and up running
99+
[Tags] Sanity
100+
... Tier1
101+
... ODS-179
102+
... RHOAIENG-13066
103+
... Monitoring
104+
Skip If RHODS Is Self-Managed
105+
@{targets} = Prometheus.Get Target Pools Which Have State Up
106+
... pm_url=${RHODS_PROMETHEUS_URL}
107+
... pm_token=${RHODS_PROMETHEUS_TOKEN}
108+
... username=${OCP_ADMIN_USER.USERNAME}
109+
... password=${OCP_ADMIN_USER.PASSWORD}
110+
List Should Contain Value ${targets} CodeFlare Operator
111+
List Should Contain Value ${targets} Data Science Pipelines Operator
112+
List Should Contain Value ${targets} Federate Prometheus
113+
List Should Contain Value ${targets} Kserve Controller Manager
114+
List Should Contain Value ${targets} KubeRay Operator
115+
List Should Contain Value ${targets} Kubeflow Notebook Controller Service Metrics
116+
List Should Contain Value ${targets} Kueue Operator
117+
List Should Contain Value ${targets} Modelmesh Controller
118+
List Should Contain Value ${targets} ODH Model Controller
119+
List Should Contain Value ${targets} ODH Notebook Controller Service Metrics
120+
List Should Contain Value ${targets} TrustyAI Controller Manager
121+
List Should Contain Value ${targets} user_facing_endpoints_status_codeflare
122+
List Should Contain Value ${targets} user_facing_endpoints_status_dsp
123+
List Should Contain Value ${targets} user_facing_endpoints_status_rhods_dashboard
124+
List Should Contain Value ${targets} user_facing_endpoints_status_workbenches
125+
126+
97127
*** Keywords ***
98128
Begin Metrics Web Test
99129
[Documentation] Test Setup

0 commit comments

Comments
 (0)