From dc3cc9c1ef0346a9124f08e8e2d40c4683dd4c2a Mon Sep 17 00:00:00 2001 From: Jorge Garcia Oncins Date: Tue, 9 Apr 2024 16:10:54 +0200 Subject: [PATCH 1/3] Speed up keyword "Is RHODS Self-Managed" RHOSi Setup is calling the keyword "Is RHODS Self-Managed", which is currently using the Robot Framework OpenShiftLibrary. The problem is that this library takes more than 10s to load, slowing down development in local. This PR modifies the keyword not to use that library in this particular keyword Signed-off-by: Jorge Garcia Oncins --- ods_ci/tests/Resources/OCP.resource | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index c5d40ff16..c49bc2a61 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -65,11 +65,8 @@ Is RHODS Self-Managed ... in the cluster (e.g., usually on OSD, ROSA). ... Returns ${TRUE} if RHODS Self-Managed is installed or if PRODUCT=ODH IF "${PRODUCT}" == "ODH" RETURN ${TRUE} - ${is_managed} = Run Keyword And Return Status OpenshiftLibrary.Oc Get - ... kind=CatalogSource - ... name=addon-managed-odh-catalog - ... namespace=${OPERATOR_NAMESPACE} - Run Keyword And Return Evaluate not ${is_managed} + ${rc} = Run And Return Rc oc get catalogsource addon-managed-odh-catalog -n ${OPERATOR_NAMESPACE} + Run Keyword And Return Run Keyword And Return Status Should Not Be Equal As Numbers ${rc} ${0} Get MachineSets [Documentation] Returns a list of machinesets names @@ -223,7 +220,7 @@ Verify Pod Logs Do Not Contain ${match_list} Get Regexp Matches ${pod_logs} ${regex_pattern} ${entry_msg} Remove Duplicates ${match_list} ${length} Get Length ${entry_msg} - IF ${length} != ${0} FAIL Pod ${pod_name} logs should not contain regexp ${regex_pattern}. Matching log entry: ${entry_msg} + IF ${length} != ${0} FAIL Pod ${pod_name} logs should not contain regexp ${regex_pattern}. Matching log entry: ${entry_msg} ... ELSE Log message=Pod ${pod_name} logs does not contain regexp ${regex_pattern} level=INFO Is Resource Present From d353471001228901f6d11614b2661abd8d06aeae Mon Sep 17 00:00:00 2001 From: Jorge Garcia Oncins Date: Tue, 9 Apr 2024 17:48:01 +0200 Subject: [PATCH 2/3] Fix new robocop warning Signed-off-by: Jorge Garcia Oncins --- ods_ci/tests/Resources/OCP.resource | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index c49bc2a61..c6871635a 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -65,7 +65,7 @@ Is RHODS Self-Managed ... in the cluster (e.g., usually on OSD, ROSA). ... Returns ${TRUE} if RHODS Self-Managed is installed or if PRODUCT=ODH IF "${PRODUCT}" == "ODH" RETURN ${TRUE} - ${rc} = Run And Return Rc oc get catalogsource addon-managed-odh-catalog -n ${OPERATOR_NAMESPACE} + ${rc}= Run And Return Rc oc get catalogsource addon-managed-odh-catalog -n ${OPERATOR_NAMESPACE} Run Keyword And Return Run Keyword And Return Status Should Not Be Equal As Numbers ${rc} ${0} Get MachineSets From 1d4e8cb9cc7fe8a794aae10da7f271f96e75e346 Mon Sep 17 00:00:00 2001 From: Jorge Garcia Oncins Date: Tue, 9 Apr 2024 18:21:43 +0200 Subject: [PATCH 3/3] Add comment about the reasons not to use OpenShift library Signed-off-by: Jorge Garcia Oncins --- ods_ci/tests/Resources/OCP.resource | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index c6871635a..91f6eae97 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -62,8 +62,11 @@ Verify Notebook CR Is Running Is RHODS Self-Managed [Documentation] Returns ${FALSE} if RHODS Managed (i.e., Cloud version) is installed - ... in the cluster (e.g., usually on OSD, ROSA). - ... Returns ${TRUE} if RHODS Self-Managed is installed or if PRODUCT=ODH + ... in the cluster (e.g., usually on OSD, ROSA). + ... Returns ${TRUE} if RHODS Self-Managed is installed or if PRODUCT=ODH + ... + ... Note: this keyword is not using OpenShift library to speed up its execution on local. + ... You'll find more info at https://github.com/red-hat-data-services/ods-ci/pull/1366 IF "${PRODUCT}" == "ODH" RETURN ${TRUE} ${rc}= Run And Return Rc oc get catalogsource addon-managed-odh-catalog -n ${OPERATOR_NAMESPACE} Run Keyword And Return Run Keyword And Return Status Should Not Be Equal As Numbers ${rc} ${0}