Skip to content

Commit

Permalink
Delete Pipeline Server (red-hat-data-services#848)
Browse files Browse the repository at this point in the history
Delete Pipeline Server
  • Loading branch information
diegolovison authored Jul 18, 2023
1 parent 928b9ed commit 95d3534
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 23 deletions.
11 changes: 7 additions & 4 deletions ods_ci/tests/Resources/Page/ODH/ODHDashboard/ODHDashboard.robot
Original file line number Diff line number Diff line change
Expand Up @@ -805,19 +805,22 @@ Reload RHODS Dashboard Page
Handle Deletion Confirmation Modal
[Documentation] Handles confirmation modal on item deletion
[Arguments] ${item_title} ${item_type} ${press_cancel}=${FALSE} ${additional_msg}=${NONE}
# Once fixed https://issues.redhat.com/browse/RHODS-9730 change the button xpath to
# xpath=//button[text()="Delete ${item_type}"]
${delete_btn_xp} Set Variable xpath=//button[contains(text(), 'Delete')]
Wait Until Generic Modal Appears
Run Keyword And Warn On Failure Page Should Contain Delete ${item_type}?
Run Keyword And Continue On Failure Page Should Contain This action cannot be undone.
Run Keyword And Warn On Failure Page Should Contain This action cannot be undone.
IF "${additional_msg}" != "${NONE}"
Run Keyword And Continue On Failure Page Should Contain ${additional_msg}
END
Run Keyword And Continue On Failure Page Should Contain Confirm deletion by typing ${item_title} below:
Run Keyword And Continue On Failure Element Should Be Disabled xpath=//button[text()="Delete ${item_type}"]
Run Keyword And Continue On Failure Element Should Be Disabled ${delete_btn_xp}
Input Text xpath=//input[@id="delete-modal-input"] ${item_title}
Wait Until Element Is Enabled xpath=//button[text()="Delete ${item_type}"]
Wait Until Element Is Enabled ${delete_btn_xp}
IF ${press_cancel} == ${TRUE}
Click Button ${GENERIC_CANCEL_BTN_XP}
ELSE
Click Button xpath=//button[text()="Delete ${item_type}"]
Click Button ${delete_btn_xp}
END
Wait Until Generic Modal Disappears
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,15 @@ Delete Pipeline
Pipelines.Click Action From Actions Menu ${pipeline_name} Delete
Handle Deletion Confirmation Modal ${pipeline_name} pipeline
Wait Until Page Contains Element xpath://h4[contains(text(), 'No pipelines yet')]

Delete Pipeline Server
[Documentation] Delete a pipeline server. From the top right menu inside "Data Science Pipelines" -> Pipelines
[Arguments] ${data_science_project_name}
Wait Until Page Contains Element xpath://button[contains(span/text(), 'Pipeline server actions')]
Click Element //button[contains(span/text(), 'Pipeline server actions')]
Wait Until Page Contains Element xpath://li[contains(a/text(), 'Delete pipeline server')]
Click Element //li[contains(a/text(), 'Delete pipeline server')]
Handle Deletion Confirmation Modal ${data_science_project_name} pipeline server pipeline server
Wait Until Page Contains Element xpath://h2[contains(text(), 'No pipeline server')]
${pod_count} Run oc get pods -n ${data_science_project_name} | wc -l
Should Be True ${pod_count} == 0 Pods weren't removed
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ Delete Data Science Project
Handle Deletion Confirmation Modal item_title=${project_title} item_type=project
... press_cancel=${press_cancel}
... additional_msg=It will destroy all workbenches, storages, data connections and other resources in ${project_title}
Wait Until Data Science Project Is Deleted project_title=${project_title}

Wait Until Data Science Project Is Deleted
[Documentation] Checks if when a DS Project is deleted its Openshift namespace gets deleted too
[Arguments] ${project_title}
Wait Until Keyword Succeeds 15 times 2s
... Project Should Not Exist In Openshift project_title=${project_title}

Project Should Not Exist In Openshift
[Documentation] Checks a given Project is not present in openshift
[Arguments] ${project_title}
${k8s_name} = Get Openshift Namespace From Data Science Project project_title=${project_title}
IF "${k8s_name}" != "${EMPTY}"
Fail msg=The project ${project_title} exists!
END

Wait Until Project Is Open
[Documentation] Waits until a DS Project Details page is laoded
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Storage Size Should Be
Run Keyword And Continue On Failure Wait Until Page Contains Element ${STORAGE_SECTION_XP}
Click Element ${STORAGE_SECTION_XP}//tr[td//*/div[text()="${name}"]]//button[@aria-label="Details"]
Wait Until Element Is Visible ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]
Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3] timeout=45s
${displayed_size}= Get Text ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div/div[3]
Run Keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} ${size}Gi
Wait Until Page Contains Element ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div timeout=45s
${displayed_size}= Get Text ${STORAGE_SECTION_XP}//tr[@class="pf-c-table__expandable-row pf-m-expanded"]/td/div[strong[text()="Size"]]/div
Run Keyword And Continue On Failure Should Be Equal As Strings ${displayed_size} Max ${size}Gi
${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].spec.resources.requests.storage}'
Run Keyword And Continue On Failure Should Be Equal As Strings ${oc_object_size} ${size}Gi
${rc} ${oc_object_size}= Run And Return Rc And Output oc get pvc -n ${namespace} -o jsonpath='{.items[?(@.metadata.annotations.openshift\\.io/display-name=="${name}")].status.capacity.storage}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ Verify User Can Create Environment Variables By Uploading YAML Secret/ConfigMap
${test_envs_list}= Create List ${test_envs_var_secret} ${test_envs_var_cm}
Environment Variables Should Be Displayed According To Their Type
... workbench_title=${WORKBENCH_4_TITLE} exp_env_variables=${test_envs_list}
Wait Until Workbench Is Started workbench_title=${WORKBENCH_4_TITLE}
Launch And Access Workbench workbench_title=${WORKBENCH_4_TITLE}
... username=${TEST_USER_3.USERNAME} password=${TEST_USER_3.PASSWORD}
... auth_type=${TEST_USER_3.AUTH_TYPE}
Expand Down Expand Up @@ -471,7 +472,7 @@ Verify Event Log Is Accessible While Starting A Workbench
Open Notebook Event Log workbench_title=${WORKBENCH_6_TITLE}
Page Should Contain Event Log
Wait Until Workbench Is Started workbench_title=${WORKBENCH_6_TITLE}
Page Should Contain Event Log expected_progress_text=Oauth proxy container started
Page Should Contain Event Log expected_progress_text=Pod assigned
... expected_result_text=Success
Close Event Log
Wait Until Project Is Open project_title=${PRJ_TITLE}
Expand Down Expand Up @@ -504,7 +505,6 @@ Verify User Can Delete A Data Science Project
[Tags] Sanity Tier1 ODS-1784
[Documentation] Verifies users can delete a Data Science project
Delete Data Science Project project_title=${PRJ_TITLE}
Wait Until Data Science Project Is Deleted project_title=${PRJ_TITLE}
# check workbenches and resources get deleted too

Verify User Can Edit A S3 Data Connection
Expand Down Expand Up @@ -629,20 +629,6 @@ Check Storage PersistentVolumeClaim Is Deleted
Fail msg=The PVC for ${storage_name} storage is still present, while it should have been deleted.
END

Wait Until Data Science Project Is Deleted
[Documentation] Checks if when a DS Project is deleted its Openshift namespace gets deleted too
[Arguments] ${project_title}
Wait Until Keyword Succeeds 15 times 2s
... Project Should Not Exist In Openshift project_title=${project_title}

Project Should Not Exist In Openshift
[Documentation] Checks a given Project is not present in openshift
[Arguments] ${project_title}
${k8s_name} = Get Openshift Namespace From Data Science Project project_title=${project_title}
IF "${k8s_name}" != "${EMPTY}"
Fail msg=The project ${project_title} exists!
END

Environment Variables Should Be Available In Jupyter
[Documentation] Runs code in JupyterLab to check if the expected environment variables are available
[Arguments] ${exp_env_variables}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Verify User Can Create, Run and Delete A DS Pipeline From DS Project Details Pag
... workflow_name=${workflow_name}
Delete Pipeline Run ${PIPELINE_TEST_RUN_BASENAME} ${PIPELINE_TEST_NAME}
Delete Pipeline ${PIPELINE_TEST_NAME}
Delete Pipeline Server ${PRJ_TITLE}
Delete Data Science Project ${PRJ_TITLE}

*** Keywords ***
Expand Down

0 comments on commit 95d3534

Please sign in to comment.