Policy API/PAP Upgrade for Spring Actuator 18/135718/4
authoradheli.tavares <adheli.tavares@est.tech>
Wed, 9 Aug 2023 15:08:56 +0000 (16:08 +0100)
committeradheli.tavares <adheli.tavares@est.tech>
Fri, 25 Aug 2023 14:31:22 +0000 (15:31 +0100)
- fix the metrics response from upgrading actuator in policy api/pap

Issue-ID: POLICY-4670
Change-Id: I29f15a4ee8279743dcdd02006d7c21864feb85a9
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
compose/export-ports.sh
compose/fixed-versions.sh [new file with mode: 0755]
compose/start-compose.sh
csit/resources/tests/api-test.robot
csit/resources/tests/pap-test.robot

index 5d64e1f..701449e 100755 (executable)
 
 if $(docker images | grep -q "onap\/policy-api")
 then
-    CONTAINER_LOCATION=$(
+    export CONTAINER_LOCATION=$(
         docker images |
         grep onap/policy-api |
         head -1 |
         sed 's/onap\/policy-api.*$//'
     )
-    export CONTAINER_LOCATION
 else
     export CONTAINER_LOCATION="nexus3.onap.org:10001/"
 fi
diff --git a/compose/fixed-versions.sh b/compose/fixed-versions.sh
new file mode 100755 (executable)
index 0000000..af99f2b
--- /dev/null
@@ -0,0 +1,57 @@
+#! /bin/bash
+
+# ============LICENSE_START====================================================
+#  Copyright (C) 2023 Nordix Foundation.
+# =============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+if [ -z "${WORKSPACE}" ]; then
+    WORKSPACE=$(git rev-parse --show-toplevel)
+    export WORKSPACE
+fi
+
+GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
+                    "${WORKSPACE}"/.gitreview)
+
+echo GERRIT_BRANCH="${GERRIT_BRANCH}"
+
+export POLICY_MARIADB_VER=10.10.2
+echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
+
+export POLICY_POSTGRES_VER=11.1
+echo POLICY_POSTGRES_VER=${POLICY_POSTGRES_VER}
+
+export POLICY_DOCKER_VERSION="3.0.1-SNAPSHOT"
+
+export POLICY_MODELS_VERSION="3.0.1-SNAPSHOT"
+
+export POLICY_API_VERSION="3.0.1-SNAPSHOT"
+
+export POLICY_PAP_VERSION="3.0.1-SNAPSHOT"
+
+export POLICY_APEX_PDP_VERSION="3.0.1-SNAPSHOT"
+
+export POLICY_DROOLS_PDP_VERSION="2.0.0-SNAPSHOT"
+
+export POLICY_XACML_PDP_VERSION="3.0.0-SNAPSHOT"
+
+export POLICY_DISTRIBUTION_VERSION="3.0.1-SNAPSHOT"
+
+export POLICY_CLAMP_VERSION="7.0.1-SNAPSHOT"
+
+export POLICY_GUI_VERSION="3.0.0-SNAPSHOT"
+
+export POLICY_DROOLS_APPS_VERSION="2.0.0-SNAPSHOT"
index 49006f1..f4ded5c 100755 (executable)
@@ -61,7 +61,7 @@ cd ${COMPOSE_FOLDER}
 
 echo "Configuring docker compose..."
 source export-ports.sh > /dev/null 2>&1
-source get-versions.sh > /dev/null 2>&1
+source fixed-versions.sh > /dev/null 2>&1
 
 # in case of csit running for PAP (groups should be for pap) but starts apex-pdp for dependencies.
 if [ -z "$PROJECT" ]; then
index 74ea7c4..9bb2254 100644 (file)
@@ -108,16 +108,16 @@ Metrics
     [Documentation]  Verify policy-api is exporting prometheus metrics
     ${auth}=  PolicyAdminAuth
     ${resp}=  GetMetrics  ${POLICY_API_IP}  ${auth}  /policy/api/v1/
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",}
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policies",} 1.0
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/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="/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="/policytypes",} 1.0
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{versionId}",} 3.0
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="DELETE",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policies",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="POST",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="POST",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="DELETE",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="DELETE",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{versionId}",} 3.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="DELETE",outcome="SUCCESS",status="200",uri="/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
index 09c2640..8232843 100644 (file)
@@ -54,8 +54,8 @@ Metrics
     [Documentation]  Verify policy pap is exporting prometheus metrics
     ${auth}=  PolicyAdminAuth
     ${resp}=  GetMetrics  ${POLICY_PAP_IP}  ${auth}  /policy/pap/v1/
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",}
-    Should Contain  ${resp.text}  http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/components/healthcheck",} 1.0
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",}
+    Should Contain  ${resp.text}  http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/components/healthcheck",} 1.0
     Should Contain  ${resp.text}  spring_data_repository_invocations_seconds_count{exception="None",method="save",repository="PdpGroupRepository",state="SUCCESS",} 1.0
     Should Contain  ${resp.text}  spring_data_repository_invocations_seconds_count{exception="None",method="findByKeyName",repository="PdpGroupRepository",state="SUCCESS",} 1.0
     Should Contain  ${resp.text}  spring_data_repository_invocations_seconds_count{exception="None",method="findAll",repository="PolicyStatusRepository",state="SUCCESS",}