Skip to content

Commit

Permalink
Fix: Dashboard related model serving issues (red-hat-data-services#2022)
Browse files Browse the repository at this point in the history
* fix: ODS-2206, wrong pipelines xpath

* fix model serving issues

* fix wrong xpath
  • Loading branch information
FedeAlonso authored and Lena Horsley committed Nov 18, 2024
1 parent c0a6e17 commit d48b5c4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ Wait For RHODS Dashboard To Load
IF "${expected_page}" == "${NONE}"
Wait Until Page Contains Element //div[@data-testid="home-page"] timeout=${timeout}
ELSE
Menu.Navigate To Page ${expected_page}
Wait Until Keyword Succeeds 3x 5s
... Wait For Dashboard Page Title ${expected_page} timeout=${timeout}
END
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ ${PROJECT_CREATE_BTN_XP}= xpath=//button[text()="Create data science project
${ACTIONS_BTN_XP}= xpath=//div/button[@aria-label="Actions"]
${DELETE_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Delete project"]
${EDIT_ACTION_BTN_XP}= xpath=//div/ul/li/button[text()="Edit project"]
${SPAWNER_LINK}= //*[@data-testid="launch-standalone-notebook-server"]
${SPAWNER_LINK}= xpath=//a[@data-testid="launch-standalone-notebook-server"]
${PROJECT_SEARCH_BAR}= [data-testid="projects-table-toolbar"]
${PROJECT_FILTER_TYPE}= ${PROJECT_SEARCH_BAR} [data-testid="filter-toolbar-dropdown"]
${PROJECT_SEARCH_INPUT}= ${PROJECT_SEARCH_BAR} [data-testid="filter-toolbar-text-field"] input

*** Keywords ***
Open Data Science Projects Home Page
[Documentation] Open "Data Science Projects" page from the sidebar
Wait Until Page Contains Data Science Projects
Click Link Data Science Projects
Wait For RHODS Dashboard To Load wait_for_cards=${FALSE} expected_page=Data Science Projects
Maybe Wait For Dashboard Loading Spinner Page

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ${MS_TABLE_STATUS_FAILURE}= /ancestor::tr//td[@data-label="Status"]//span[co
${KSERVE_MODAL_HEADER}= //header[@class="pf-v5-c-modal-box__header"]/h1[.="Deploy model"]
${KSERVE_RUNTIME_DROPDOWN}= //button[@data-testid="serving-runtime-template-selection"]
${LLM_RESOURCES_DIRPATH}= tests/Resources/Files/llm
${DEPLOY_SINGLE_SV_MODEL_BTN}= //button[contains(@data-testid,"single-serving-select-button")]
${DEPLOY_SINGLE_SV_MODEL_BTN}= //button[@data-testid="single-serving-select-button"]
${DEPLOY_SINGLE_MODEL_BTN}= //button[contains(@data-testid,"deploy-button")]
${DEPLOY_MODEL_BTN}= //button[contains(@data-testid,"deploy-button")]
${TOKEN_AUTH_CHECKBOX_XP}= xpath://input[@id="alt-form-checkbox-auth"]
Expand Down Expand Up @@ -143,14 +143,22 @@ Select Framework
Select Existing Data Connection
[Documentation] Selects an existing data connection in the "deploy model" modal.
[Arguments] ${data_connection_name} ${retries}=1
FOR ${retry_idx} IN RANGE 0 1+${retries}
Open Name Options Menu
Click Element xpath://li/button[.="${data_connection_name}"]
${selected}= Run Keyword And Return Status
... Page Should Contain Element //span[.="Name"]/../../..//button[@aria-label="Options menu"][.="${data_connection_name}"] #robocop: disable
IF ${selected}==${TRUE}
BREAK

${is_enabled}= Run Keyword And Return Status
... Element Should Be Enabled xpath://button[@id="inference-service-data-connection"]

IF ${is_enabled}
FOR ${retry_idx} IN RANGE 0 1+${retries}
Open Name Options Menu
Click Element xpath://li/button[.="${data_connection_name}"]
${selected}= Run Keyword And Return Status
... Page Should Contain Element //span[.="Name"]/../../..//button[@aria-label="Options menu"][.="${data_connection_name}"] #robocop: disable
IF ${selected}==${TRUE} BREAK
END
ELSE
Element Should Be Disabled id:inference-service-data-connection
${text}= Get Text xpath://button[@id="inference-service-data-connection"]/span/div/div
Should Be Equal ${text} ${data_connection_name}
END

Set Folder Path
Expand Down Expand Up @@ -210,22 +218,26 @@ Get Model Route Via UI
[Documentation] Grabs the serving route (URL) of an already deployed model from the Model Serving page.
[Arguments] ${model_name}
# TODO: Open model serving home page if needed?
${route_xpath}= Set Variable //a[.="${model_name}"]${MS_TABLE_ENDPOINT_INPUT}
${loaded}= Run Keyword And Return Status SeleniumLibrary.Wait Until Page Contains Element ${route_xpath} timeout=15s
IF ${loaded} == ${FALSE}
Log message=Model Route was not loaded in UI (RHOAIENG-1919). Trying refreshing! level=WARN
SeleniumLibrary.Reload Page
SeleniumLibrary.Wait Until Page Contains Element ${route_xpath} timeout=15s
END
${url}= SeleniumLibrary.Get Element Attribute ${route_xpath} value
# Click on Inference Endpoints link
${endpoint_link}= Set Variable //a[@data-testid="metrics-link-test-model" and text()="${model_name}"]/ancestor::tr//td//button[@data-testid="internal-external-service-button"]
SeleniumLibrary.Wait Until Page Contains Element ${endpoint_link}
SeleniumLibrary.Click Button ${endpoint_link}
# Get the external URL
${route_xpath}= Set Variable //span[text()="External (can be accessed from inside or outside the cluster)"]/ancestor::dl//dd/div/div/span[1]
SeleniumLibrary.Wait Until Page Contains Element //div[@data-testid="external-service-popover"]
SeleniumLibrary.Wait Until Page Contains Element ${route_xpath}
# Get the URL
Sleep 2 reason=The element takes a little bit longer than expected rendering the url
${url}= Get Text ${route_xpath}
${kserve}= Run Keyword And Return Status SeleniumLibrary.Page Should Contain Single-model serving enabled
IF ${kserve}
${url}= Catenate SEPARATOR= ${url} /v2/models/${model_name}/infer
END
RETURN ${url}


Get Model Route for gRPC Via UI
[Arguments] ${model_name}
[Arguments] ${model_name}
${host_url}= Get Model Route Via UI model_name=${model_name}
${host}= Evaluate re.search(r"${GRPC_URL_REGEX}", r"${host_url}").group(1) re
RETURN ${host}
Expand Down

0 comments on commit d48b5c4

Please sign in to comment.