Skip to content

Commit

Permalink
Fix dashboard RBAC issue, fix cli timing issue
Browse files Browse the repository at this point in the history
Signed-off-by: lugi0 <[email protected]>
  • Loading branch information
lugi0 committed Nov 14, 2024
1 parent 70db5c4 commit 66da484
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ods_ci/tests/Resources/Page/ModelRegistry/ModelRegistry.resource
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,13 @@ Open Model Registry Dashboard Page
Maybe Wait For Dashboard Loading Spinner Page
${loaded}= Run Keyword And Return Status
... SeleniumLibrary.Page Should Not Contain Request access to model registries
WHILE ${loaded}!=${TRUE} limit=5
WHILE ${loaded}!=${TRUE} limit=12 # Retries for 2 minutes - wait for user group to reconcile
SeleniumLibrary.Reload Page
SeleniumLibrary.Wait Until Page Contains Model Registry
SeleniumLibrary.Wait Until Page Contains Select a model registry to view and manage your registered models.
${loaded}= Run Keyword And Return Status
... SeleniumLibrary.Page Should Not Contain Request access to model registries
Sleep 10s
END
Maybe Wait For Dashboard Loading Spinner Page

Expand Down Expand Up @@ -381,6 +382,7 @@ Model Registry Post Upgrade Scenario
Should Be Equal As Strings ${operator_grpc} ${instance_grpc}
Launch Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
... ${ODH_DASHBOARD_URL} ${BROWSER.NAME} ${BROWSER.OPTIONS}
Add User To Model Registry Default Group ${TEST_USER.USERNAME}
Open Model Registry Dashboard Page
SeleniumLibrary.Page Should Contain Element
... xpath:${MR_TABLE_XPATH}/tbody/tr/td[@data-label="Model name"]//a[.="${MR_REGISTERED_MODEL_NAME}"]
Expand Down Expand Up @@ -444,4 +446,14 @@ Get Model Registry Instance ${type} Image
${rc} ${img}= Run And Return RC And Output
... oc get pod -l app=${instance_name} -n ${ns} -o yaml | yq '.items[].spec.containers[] | select(.name=="${type}-container").image'
Should Be Equal As Integers ${rc} 0
RETURN ${img}
RETURN ${img}

Add User To Model Registry Default Group
[Documentation] Dashboard creates a default user group to give read/write permissions to a MR instance. We need
... to add our test user to this group in order to be able to interact with it.
[Arguments] ${user} ${model_registry_name}=modelregistry-sample
${rc}= Run And Return Rc oc get group ${model_registry_name}-users
Should Be Equal As Integers ${rc} 0
${rc} ${out}= Run And Return Rc And Output oc adm groups add-users ${model_registry_name}-users ${user}
Should Be Equal As Integers ${rc} 0
Should Be Equal As Strings ${out} group.user.openshift.io/${model_registry_name}-users added: "${user}"
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Verify Model Registry Integration With Secured-DB
IF ${self_managed} Upload Certificate To Jupyter Notebook openshift_ca.crt
Jupyter Notebook Can Query Model Registry ${JUPYTER_NOTEBOOK}
SeleniumLibrary.Switch Window ${handle}
Add User To Model Registry Default Group ${TEST_USER.USERNAME}
Open Model Registry Dashboard Page
SeleniumLibrary.Page Should Contain Element xpath:${MR_TABLE_XPATH}/tbody/tr/td[@data-label="Model name"]//a[.="${MR_REGISTERED_MODEL_NAME}"]
SeleniumLibrary.Page Should Contain Element xpath:${MR_TABLE_XPATH}/tbody/tr/td[@data-label="Owner"]//p[.="${MR_REGISTERED_MODEL_AUTHOR}"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ Deploy Model Registry
RHOSi Setup
Enable Model Registry If Needed
Component Should Be Enabled modelregistry
Sleep 60s reason=Wait for webhook endpoint
Apply Db Config Samples

Registering A Model In The Registry
[Documentation] Registers a model in the model registry
[Tags] Smoke MR1302 ModelRegistry
Depends On Test Deploy Model Registry
Register A Model ${URL}

Verify Model Registry
[Documentation] Deploy Python Client And Register Model.
[Tags] Smoke MR1302 ModelRegistry
Depends On Test Registering A Model In The Registry
Run Curl Command And Verify Response ${URL}


Expand Down

0 comments on commit 66da484

Please sign in to comment.