Skip to content

Commit

Permalink
Reduce number of IDE errors and wrong imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kornys committed Sep 7, 2023
1 parent f52b33a commit 9907434
Show file tree
Hide file tree
Showing 47 changed files with 103 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ results/
__pycache__/
robocop.log
infrastructure_configuration.yaml
ods-ci.log*
log/
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*** Settings ***
Resource ../../Common.robot
Library SeleniumLibrary

*** Keywords ***
Expand Down
2 changes: 2 additions & 0 deletions ods_ci/tests/Resources/Page/HybridCloudConsole/OCM.robot
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*** Settings ***
Resource ../../Common.robot

Library SeleniumLibrary


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Library Collections
Library SeleniumLibrary

*** Keywords ***
Is SSO Login Page Visible
Expand Down Expand Up @@ -59,4 +60,4 @@ Launch Cluster Tab from Marketplace
Click Button Add cluster
Wait Until Page Contains Register cluster timeout=120
${status} Run Keyword and Return Status Page Should Contain Register cluster
RETURN ${status}
RETURN ${status}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Documentation Collections of keyword to handle Deployment config objects in OCP
Library OpenShiftLibrary
Library OperatingSystem


*** Keywords ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Operator Should Be Uninstalled

Switch To New Tab
[Arguments] ${tabname}
Click Element //a[normalize-space(text())="${tabname}"]
Click Element //a[normalize-space(text())="${tabname}"]

Click On Searched Operator
[Arguments] ${operator}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*** Settings ***
Resource ../OCPMenu.robot

*** Keywords ***
Open Installed Operators Page
Login to OCP Console
Expand Down
4 changes: 3 additions & 1 deletion ods_ci/tests/Resources/Page/OCPDashboard/Page.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*** Settings ***
Library SeleniumLibrary
Resource ../Components/Menu.robot
Resource ../../Common.robot
Library SeleniumLibrary

*** Keywords ***
Open Page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Library OpenShiftLibrary
Library OperatingSystem
Library Collections
Resource ../../../Page/Components/Components.resource


Expand Down
12 changes: 7 additions & 5 deletions ods_ci/tests/Resources/Page/OCPLogin/OCPLogin.robot
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
*** Settings ***
Documentation Set of Keywords for OCP login
Library OperatingSystem
Library OperatingSystem
Resource ../LoginPage.robot

*** Keywords ***
Login To OCP
Login To Openshift
... ${OCP_ADMIN_USER.USERNAME}
... ${OCP_ADMIN_USER.PASSWORD}
... ${OCP_ADMIN_USER.AUTH_TYPE}
Login To Openshift
... ${OCP_ADMIN_USER.USERNAME}
... ${OCP_ADMIN_USER.PASSWORD}
... ${OCP_ADMIN_USER.AUTH_TYPE}

Login To OCP Using API
[Documentation] Login to openshitf using username and password
Expand Down
1 change: 1 addition & 0 deletions ods_ci/tests/Resources/Page/ODH/AiApps/Aikit.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Documentation Resource file for aikit operator
Resource ../JupyterHub/JupyterHubSpawner.robot
Library SeleniumLibrary
Library OpenShiftLibrary

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Documentation Collections of keywords to interact with Managed Starburst
Resource ../JupyterHub/JupyterLabLauncher.robot
Library OperatingSystem
Library OpenShiftLibrary
Library SeleniumLibrary
Expand Down
2 changes: 1 addition & 1 deletion ods_ci/tests/Resources/Page/ODH/AiApps/Openvino.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** Settings ***
Documentation Resource file for openvino operator
Resource ../JupyterHub/JupyterHubSpawner.robot
Library SeleniumLibrary


Expand Down
1 change: 1 addition & 0 deletions ods_ci/tests/Resources/Page/ODH/AiApps/Pachyderm.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Documentation Resource file for pachyderm operator
Resource ../JupyterHub/JupyterLabLauncher.robot
Library SeleniumLibrary


Expand Down
2 changes: 2 additions & 0 deletions ods_ci/tests/Resources/Page/ODH/JupyterHub/Elyra.resource
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*** Settings ***
Documentation Keywords to interact with Elyra in JupyterLab
Resource ../../LoginPage.robot
Library SeleniumLibrary


*** Variables ***
Expand Down
4 changes: 3 additions & 1 deletion ods_ci/tests/Resources/Page/ODH/JupyterHub/GPU.resource
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*** Settings ***
Documentation Set of Keywords for GPU support
Resource ../../../OCP.resource
Library OperatingSystem


*** Keywords ***
Expand Down Expand Up @@ -88,4 +90,4 @@ Is GPU Autoscaling Enabled
END
END
END
RETURN ${autoscaling_enabled}
RETURN ${autoscaling_enabled}
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Spawn Notebook With Arguments # robocop: disable
ELSE IF ${gpu_visible}==False and ${gpus}>0
IF ${index} < ${retries}
Sleep 30s reason=Wait for GPU to free up
SeleniumLibrary.Reload Page
Reload Page
Wait Until JupyterHub Spawner Is Ready
CONTINUE
ELSE
Expand Down Expand Up @@ -628,12 +628,12 @@ Log In N Users To JupyterLab And Launch A Notebook For Each Of Them
Fix Spawner Status
Spawn Notebook With Arguments
END
[Teardown] SeleniumLibrary.Close All Browsers
[Teardown] Close All Browsers

CleanUp JupyterHub For N Users
[Documentation] Cleans JupyterHub for N users
[Arguments] ${list_of_usernames}
SeleniumLibrary.Close All Browsers
Close All Browsers
FOR ${username} IN @{list_of_usernames}
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS} alias=${username}
Login To RHODS Dashboard ${username} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Expand All @@ -646,7 +646,7 @@ CleanUp JupyterHub For N Users
#Fix Spawner Status stops the current notebook, handling the different possible states
Fix Spawner Status
END
[Teardown] SeleniumLibrary.Close All Browsers
[Teardown] Close All Browsers

Delete User Notebook CR
[Documentation] Delete the `Notebook` CR for a specific user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Library OperatingSystem
Library Screenshot
Library String
Library OpenShiftLibrary
Library SeleniumLibrary


*** Variables ***
Expand Down Expand Up @@ -98,7 +99,7 @@ Start JupyterLab Notebook Server

Open JupyterLab Control Panel
Open With JupyterLab Menu File Hub Control Panel
SeleniumLibrary.Switch Window NEW
Switch Window NEW

Stop JupyterLab Notebook Server
Open JupyterLab Control Panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Library JupyterLibrary
Library String
Library RequestsLibrary
Library Collections
*** Variables ***

*** Keywords ***
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*** Settings ***
*** Settings ***
Library JupyterLibrary

*** Keywords ***
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*** Settings ***
#Library JupyterLibrary
Resource JupyterLabLauncher.robot
Resource ./JupyterLabLauncher.robot
Library JupyterLibrary

*** Keywords ***
Expand Down Expand Up @@ -34,6 +33,6 @@ Launch Python3 JupyterLab Smoke Test Notebook
Capture Page Screenshot
Add and Run JupyterLab Code Cell %watermark --iversions
Capture Page Screenshot

JupyterLab Code Cell Error Output Should Not Be Visible

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Verify PVC Size

PVC Size Test Teardown
[Documentation] PVC change teardown
SeleniumLibrary.Close All Browsers
Close All Browsers
Change PVC Size From ConfigMap 20Gi
Run Keyword And Ignore Error Delete Pods Using Label Selector ${APPLICATIONS_NAMESPACE} app=notebook-controller

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Validate Links Extracted From Text
[Documentation] Checks the health status of the links which have been
... extracted from the quick start texts.
... It skips validation of textual links which are supposed to be
... mere examples, hence invalid links. e.g.,
... mere examples, hence invalid links. e.g.,
... http://example.apps.organization.abc3.p4.openshiftapps.com/prediction
[Arguments] ${doc_links}
FOR ${doc_link} IN @{doc_links}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Library OpenShiftLibrary
Resource ../../LoginPage.robot
Resource ../../ODH/JupyterHub/LoginJupyterHub.robot


*** Variables ***
Expand Down Expand Up @@ -44,7 +45,7 @@ Launch Dashboard And Check User Management Option Is Available For The User
${authorization_required} = Is Service Account Authorization Required
IF ${authorization_required} Authorize jupyterhub service account
Menu.Navigate To Page Settings User management
SeleniumLibrary.Wait Until Element Is Visible //*[@class="pf-c-button pf-c-select__toggle-button pf-m-plain"] timeout=20
Wait Until Element Is Visible //*[@class="pf-c-button pf-c-select__toggle-button pf-m-plain"] timeout=20

Remove OpenShift Groups From Data Science User Groups
[Documentation] Remove OpenShift Groups From Data Science User Groups From Dashboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Resource ../../../Common.robot
Resource ../../../Page/ODH/ODHDashboard/ODHDashboard.robot
Library DateTime
Library ../../../../../libs/DataSciencePipelinesAPI.py
Resource ODHDataScienceProject/Pipelines.resource
Resource ODHDataScienceProject/Pipelines.resource


*** Variables ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ Click GPU Minus Button
Verify Displayed GPU Count
[Documentation] Verifies the number of GPUs displayed in the Model Server table
[Arguments] ${server_name} ${no_gpus}
Wait Until PAge Contains Element xpath://span[.="${server_name}"]
${expanded} = Run Keyword And Return Status
Wait Until Page Contains Element xpath://span[.="${server_name}"]
${expanded} = Run Keyword And Return Status
... Page Should Contain Element xpath://button[@aria-expanded="true"]/span[.="${server_name}"]
IF ${expanded}==False
Click Element xpath://button[@aria-expanded="false"]/span[.="${server_name}"]
Expand Down Expand Up @@ -219,4 +219,4 @@ Enable Toleration Feature In KNativeServing
[Arguments] ${knative_serving_ns}
${rc} ${out}= Run And Return Rc And Output
... oc patch configmap config-features -n ${knative_serving_ns} --type=merge -p '{"data":{"kubernetes.podspec-tolerations": "enabled"}}'
Should Be Equal As Integers ${rc} ${0}
Should Be Equal As Integers ${rc} ${0}
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ RoleBinding Should Exist
Is ${username} In The Permissions Table
${present}= Run Keyword And Return Status
... Page Should Contain Element xpath=//tr[td[@data-label="Username"]//*[text()="${username}"]]
RETURN ${present}
RETURN ${present}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ ${SPAWNER_LINK}= xpath=//*[text()="Launch Jupyter"]
*** Keywords ***
Open Data Science Projects Home Page
[Documentation] Verifies submenu Settings > "Data Science Projects" is visible
SeleniumLibrary.Wait Until Page Contains Data Science Projects
SeleniumLibrary.Click Link Data Science Projects
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
SeleniumLibrary.Wait Until Page Contains View your existing projects or create new projects. timeout=30
Wait Until Page Contains View your existing projects or create new projects. timeout=30
Maybe Wait For Dashboard Loading Spinner Page

Is Data Science Projects Page Open
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ Add Environment Variables In Workbench
# The element we want to click might get pushed out of view on every loop, let's scroll by an approx
# amount of pixels for the block of elements that gets added.
IF "${add_key_value_text}" == "Add another key / value pair"
SeleniumLibrary.Execute Javascript document.getElementById("dashboard-page-main").scrollBy(0,200) # robocop: disable
Execute Javascript document.getElementById("dashboard-page-main").scrollBy(0,200) # robocop: disable
ELSE IF "${add_key_value_text}" == "Add another variable"
SeleniumLibrary.Execute Javascript document.getElementById("dashboard-page-main").scrollBy(0,700) # robocop: disable
Execute Javascript document.getElementById("dashboard-page-main").scrollBy(0,700) # robocop: disable
END
END
END
Expand Down Expand Up @@ -382,7 +382,7 @@ Start Workbench Should Fail
IF ${failed} != ${FALSE} Fail msg=Workbench is expected to fail starting...
Run Keyword And Continue On Failure Wait Until Keyword Succeeds 30 times 2s
... Status Error Icon Should Appear workbench_title=${workbench_title}
SeleniumLibrary.Reload Page
Reload Page
Workbench Should Be Listed ${workbench_title}
Wait Until Keyword Succeeds 20 times 2s
... Status Error Icon Should Appear workbench_title=${workbench_title}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ ${MS_TABLE_STATUS_FAILURE}= //span[contains(@class,"pf-c-icon__content")][con
*** Keywords ***
Open Model Serving Home Page
[Documentation] Verifies submenu Settings > "Model Serving" is visible and navigates to page
SeleniumLibrary.Page Should Contain Model Serving
SeleniumLibrary.Click Link Model Serving
Page Should Contain Model Serving
Click Link Model Serving
# Replace sleep with better Wait keyword. Confirm if error page has "Model serving" h1 element.
Sleep 1s
${loading_error} = Run Keyword And Return Status SeleniumLibrary.Page Should Contain Problem loading model serving page
${loading_error} = Run Keyword And Return Status Page Should Contain Problem loading model serving page
IF ${loading_error}
Log "Page load error encountered" level=WARN
SeleniumLibrary.Capture Page Screenshot
Capture Page Screenshot
Sleep 5s
SeleniumLibrary.Reload Page
Reload Page
END
Wait for RHODS Dashboard to Load wait_for_cards=${FALSE} expected_page=Model serving
SeleniumLibrary.Wait Until Page Contains Manage and view the health and performance of your deployed models. timeout=30
Wait Until Page Contains Manage and view the health and performance of your deployed models. timeout=30
Maybe Wait For Dashboard Loading Spinner Page

Serve Model
Expand Down Expand Up @@ -238,9 +238,9 @@ Verify Model Inference
Clean Up Model Serving Page
[Documentation] Deletes all currently deployed models, if any are present.
# Returns an empty list if no matching elements found
${models} = SeleniumLibrary.Get WebElements xpath://table/tbody/tr/td[@data-label="Name"]/div/a
${models} = Get WebElements xpath://table/tbody/tr/td[@data-label="Name"]/div/a
FOR ${model} IN @{models}
${name} = SeleniumLibrary.Get Text ${model}
${name} = Get Text ${model}
Delete Model Via UI ${name}
END

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*** Settings ***
Resource ../../OCPDashboard/InstalledOperators/InstalledOperators.robot
Library SeleniumLibrary
Library Collections
Library String
Expand Down
5 changes: 4 additions & 1 deletion ods_ci/tests/Resources/Page/ODH/Prometheus/Prometheus.robot
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
*** Settings ***
Documentation Queries Prometheus using API calls
Resource ../../../Common.robot

Library Collections
Library Process
Library RequestsLibrary
Library DateTime
Library OperatingSystem


*** Keywords ***
Expand Down Expand Up @@ -133,7 +136,7 @@ Alerts Should Not Be Firing #robocop: disable:too-many-calls-in-keyword
[Documentation] Fails if any Prometheus alert is in pending or firing state,
... excluding alert with name = ${expected-firing-alert}
[Arguments] ${pm_url} ${pm_token} ${expected-firing-alert}=${EMPTY} ${message_prefix}=${EMPTY}

${all_rules}= Get Rules ${pm_url} ${pm_token} alert
${all_rules}= Get From Dictionary ${all_rules['data']} groups
@{alerts_firing}= Create List
Expand Down
Loading

0 comments on commit 9907434

Please sign in to comment.