From 3a34857fa082055ba25659f4d1e53d61472f860c Mon Sep 17 00:00:00 2001 From: Prakhar Pandey Date: Fri, 25 Mar 2022 15:46:19 -0400 Subject: Add CSIT Test cases for api metrics Adding csit test cases for application level metrics exposed by api component. Issue-ID: POLICY-3966 Signed-off-by: Prakhar Pandey Change-Id: Iccaa1c8e55ddc5b9961371c85aa41a5371ada560 --- csit/api/tests/api-test.robot | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'csit') diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot index c5c7e860..4eb48888 100644 --- a/csit/api/tests/api-test.robot +++ b/csit/api/tests/api-test.robot @@ -11,12 +11,8 @@ Healthcheck [Documentation] Verify policy api health check ${resp}= GetReq /policy/api/v1/healthcheck Should Be Equal As Strings ${resp.json()['code']} 200 - -Metrics - [Documentation] Verify policy-api is exporting prometheus metrics - ${auth}= PolicyAdminAuth - ${resp}= GetMetrics ${POLICY_API_IP} ${auth} - Should Contain ${resp.text} jvm_threads_live_threads + Should Be Equal As Strings ${resp.json()['healthy']} True + Should Be Equal As Strings ${resp.json()['message']} alive Statistics [Documentation] Verify policy api statistics @@ -106,6 +102,28 @@ DeleteSpecificPolicyTypeV2 DeleteReq /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 200 DeleteReq /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 404 +Metrics + [Documentation] Verify policy-api is exporting prometheus metrics + ${auth}= PolicyAdminAuth + ${resp}= GetMetrics ${POLICY_API_IP} ${auth} + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/healthcheck",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/statistics",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policies",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policies/{policyId}/versions/{policyVersion}",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="POST",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policy/api/v1/policies/{policyId}/versions/{policyVersion}",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}",} 2.0 + Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_sum + Should Contain ${resp.text} http_server_requests_seconds_max + Should Contain ${resp.text} spring_data_repository_invocations_seconds_count + Should Contain ${resp.text} spring_data_repository_invocations_seconds_sum + Should Contain ${resp.text} spring_data_repository_invocations_seconds_max + Should Contain ${resp.text} jvm_threads_live_threads + *** Keywords *** GetReq -- cgit 1.2.3-korg