-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RHOAIENG-2508 ODS-2600 Validate DSC creates all Serverless CRs #1259
Changes from 14 commits
e15eb4d
132594f
bd5184c
af7b4d8
de5d3e9
8c813bb
46b2b76
8b1f734
e0fc0be
edafa97
9c34b0d
b46accf
ae0d917
43f0a2d
53e9465
e68dd21
a699a90
35c9761
1c68c23
4261ec6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,3 +200,29 @@ | |
[Arguments] ${crd_fullname} | ||
Wait Until Keyword Succeeds 15 times 5s | ||
... Oc Get kind=CustomResourceDefinition name=${crd_fullname} | ||
|
||
Resource Should Exist | ||
[Documentation] Check resource existson a namespace | ||
[Arguments] ${resource} ${resource_name} ${namespace} | ||
${rc} ${out}= Run and Return Rc And Output | ||
... oc get ${resource} ${resource_name} -n ${namespace} | ||
Should Be Equal "${rc}" "0" msg=${out} | ||
|
||
Resource Status Should Be | ||
[Documentation] Check Resource Status | ||
[Arguments] ${oc_get} ${resource} ${expected_status} | ||
${status}= Run | ||
... ${oc_get} | ||
Log ${status} console=True | ||
Should Be Equal ${status} ${expected_status} msg=${resource} is not in Ready status | ||
|
||
Check For Errors On Operator Logs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you modify this keyword (in this PR or a follow-up on) so it can be used on any pod and not just the operator pod?
And use the oc command instead of Oc Get. If you run oc logs -h you'll see that it has most of the parameters There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok Jorge I modify it |
||
[Documentation] Checks there are no errors on Operator Logs | ||
[Arguments] ${operator_name} ${operator_namespace} ${regex_pattern} | ||
${data} Run keyword Oc Get kind=Pod namespace=${operator_namespace} label_selector=name=rhods-operator | ||
|
||
${pod_logs}= Oc Get Pod Logs name=${operator_name} namespace=${operator_namespace} container=rhods-operator | ||
${match_list} Get Regexp Matches ${pod_logs} ${regex_pattern} | ||
Check warning Code scanning / Robocop The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning test
The assignment sign is not consistent within the file. Expected '=' but got '' instead
|
||
${entry_msg} Remove Duplicates ${match_list} | ||
|
||
${length} Get Length ${entry_msg} | ||
|
||
IF ${length} != ${0} FAIL Check logs, there are some ERROR entries present. | ||
|
||
... ELSE Log message=No ERROR logs found on Pod. level=INFO | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
*** Settings *** | ||
Documentation Test Cases to verify Serverless installation | ||
Library Collections | ||
Library SeleniumLibrary | ||
Library OpenShiftLibrary | ||
Resource ../../../../Resources/Page/OCPDashboard/OCPDashboard.resource | ||
Resource ../../../../Resources/OCP.resource | ||
Suite Setup Suite Setup | ||
Suite Teardown Suite Teardown | ||
|
||
|
||
*** Variables *** | ||
${SERVERLESS_APPNAME} Red Hat OpenShift Serverless | ||
${SERVERLESS_OPERATOR_NAME} Red Hat OpenShift Serverless | ||
${KNATIVESERVING_NS} knative-serving | ||
${ISTIO_NS} istio-system | ||
${regex_pattern} ERROR | ||
|
||
|
||
|
||
Check warning Code scanning / Robocop Invalid number of empty lines between sections ({{ empty_lines }}/{{ allowed_empty_lines }}) Warning test
Invalid number of empty lines between sections (1/2)
|
||
*** Test Cases *** | ||
Validate DSC creates all Serverless CRs | ||
Check warning Code scanning / Robocop Test case '{{ test_name }}' has too many keywords inside ({{ keyword_count }}/{{ max_allowed_count }}) Warning test
Test case 'Validate DSC creates all Serverless CRs' has too many keywords inside (12/10)
|
||
[Documentation] The purpose of this Test Case is to validate the creation | ||
... of Serverless Custom Resources | ||
... ProductBug: RHOAIENG-4358 | ||
[Tags] Operator ODS-2600 ProductBug | ||
Assign Vars According To Product ${PRODUCT} | ||
Check And Install Operator in Openshift ${SERVERLESS_APPNAME} ${SERVERLESS_OPERATOR_NAME} | ||
|
||
Check And Install Operator in Openshift ${OPERATOR_APPNAME} ${OPERATOR_NAME} | ||
|
||
Resource Should Exist KnativeServing knative-serving ${KNATIVESERVING_NS} | ||
Resource Status Should Be oc get KnativeServing knative-serving -n ${KNATIVESERVING_NS} -o json | jq '.status.conditions[] | select(.type=="Ready") | .status' KnativeServing "True" # robocop: disable | ||
Resource Should Exist Gateway knative-ingress-gateway ${KNATIVESERVING_NS} | ||
Resource Should Exist Gateway knative-local-gateway ${KNATIVESERVING_NS} | ||
Resource Should Exist Service knative-local-gateway ${ISTIO_NS} | ||
Resource Should Exist deployment controller ${KNATIVESERVING_NS} | ||
Wait For Pods Numbers 2 namespace=${KNATIVESERVING_NS} | ||
... label_selector=app.kubernetes.io/component=controller timeout=120 | ||
${pod_names}= Get Pod Names ${KNATIVESERVING_NS} app.kubernetes.io/component=controller | ||
Verify Containers Have Zero Restarts ${pod_names} ${KNATIVESERVING_NS} | ||
${podname}= Get Pod Name ${OPERATOR_NAMESPACE} label_selector=name=rhods-operator | ||
Check For Errors On Operator Logs ${podname} ${OPERATOR_NAMESPACE} ${regex_pattern} | ||
Read DSC Conditions ${KNATIVESERVING_NS} default-dsc | ||
|
||
|
||
*** Keywords *** | ||
Suite Setup | ||
[Documentation] Suite Setup | ||
Set Library Search Order SeleniumLibrary | ||
RHOSi Setup | ||
|
||
Suite Teardown | ||
[Documentation] Suite Teardown | ||
Close All Browsers | ||
RHOSi Teardown | ||
|
||
Assign Vars According To Product | ||
jgarciao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[Documentation] Assign vars related to product | ||
[Arguments] ${product} | ||
IF "${product}" == "RHODS" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be ${PRODUCT}, as it is a global variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks Jorge, I change it |
||
Set Suite Variable ${OPERATOR_APPNAME} Red Hat OpenShift AI | ||
Check notice Code scanning / Robocop {{ set_variable_keyword }} can be replaced with VAR Note test
Set Suite Variable can be replaced with VAR
|
||
Set Suite Variable ${OPERATOR_NAME} Red Hat OpenShift AI | ||
|
||
ELSE IF "${product}" == "ODH" | ||
Set Suite Variable ${OPERATOR_APPNAME} Open Data Hub Operator | ||
Check notice Code scanning / Robocop {{ set_variable_keyword }} can be replaced with VAR Note test
Set Suite Variable can be replaced with VAR
|
||
Set Suite Variable ${OPERATOR_NAME} Open Data Hub Operator | ||
|
||
END | ||
|
||
Read DSC Conditions | ||
[Documentation] Reads all DSC conditions | ||
[Arguments] ${namespace} ${dsc_name} | ||
${rc} ${out}= Run And Return Rc And Output | ||
... oc get DataScienceCluster ${dsc_name} -n ${namespace} -o jsonpath='{.status.conditions[].reason}' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How exactly we check the condition here? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is meant to be displayed as it is very prone to errors depending on the installation There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, the status of the components isn't stable... this is something I think that operator could also improve... the statuses are regularly changing even in case that all is fine (Ready vs Unknown). Again, I am new to the OpenShift world, so my assumption can be wrong. But wanted to say that this doesn't check anything... it just prints some info... so if that is desired and won't be changed, please rename the keyword appropriately so it's not confusing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just realized that we are checking the condition of just one component - then... shouldn't we want it to be in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed the keyword to wait for Conditions on DSC to be Reconciled successfully or timeout |
||
Should Be Equal As Integers ${rc} ${0} | ||
Log ${out} console=${out} |
Check warning
Code scanning / Robocop
Keyword name '{{ keyword_name }}' does not follow case convention Warning test