Skip to content
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

Add ODS-650 to Anaconda e2e test case #570

Merged
merged 6 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/Resources/Page/OCPDashboard/Builds/Builds.robot
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Delete BuildConfig using Name
${status} Check If BuildConfig Exists ${namespace} ${name}
Run Keyword If '${status}'=='PASS' OpenShiftCLI.Delete kind=BuildConfig name=${name} namespace=${namespace}
... ELSE FAIL No BuildConfig present with name '${name}' in '${namespace}' namespace, Check the BuildConfig name and namespace provide is correct and try again
Dependent Build should not Present ${name}
Wait Until Keyword Succeeds 10s 2s
... Dependent Build should not Present ${name}
${status} Check If BuildConfig Exists ${namespace} ${name}
Run Keyword IF '${status}'!='FAIL' FAIL BuildConfig with name '${name}' is not deleted in '${namespace}'

Expand Down
11 changes: 11 additions & 0 deletions tests/Resources/Page/ODH/AiApps/Anaconda.resource
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ ${INVALID_KEY}= abcdef-invalidkey
${ERROR_MSG}= error\nValidation failed\nError attempting to validate. Please check your entries.
${VAL_SUCCESS_MSG}= Validation result: 200
${TOKEN_VAL_SUCCESS_MSG}= Success! Your token was validated and Conda has been configured.
${PKG_INSTALL_ERROR_MSG}= Collecting package metadata (current_repodata.json): failed
... UnavailableInvalidChannel: HTTP 403 FORBIDDEN for channel repo/main <https://repo.anaconda.cloud/repo/main>
... The channel is not accessible or is invalid.
... You will need to adjust your conda configuration to proceed.
... Use `conda config --show channels` to view your configuration's current state,
... and use `conda config --show-sources` to view config file locations.
${CONDARC_CAT_RESULT}= restore_free_channel: false
... default_channels:
... - https://repo.anaconda.cloud/repo/main
... - https://repo.anaconda.cloud/repo/msys2
... - https://repo.anaconda.cloud/repo/r


*** Keywords ***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,39 @@ Verify Anaconda Professional Fails Activation When Key Is Invalid

Verify User Is Able to Activate Anaconda Professional
[Tags] Tier2
... ODS-272 ODS-344 ODS-501 ODS-588 ODS-1082 ODS-1304 ODS-462 ODS-283
... ProductBug
... ODS-272 ODS-344 ODS-501 ODS-588 ODS-1082 ODS-1304 ODS-462 ODS-283 ODS-650
[Documentation] Performs the Anaconda CE activation, spawns a JL using the Anaconda image,
... validate the token, install a library and try to import it.
... At the end, it stops the JL server and returns to the spawner
Verify Anaconda In Kfdef
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Login To RHODS Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Wait For RHODS Dashboard To Load
Launch Dashboard ocp_user_name=${TEST_USER.USERNAME} ocp_user_pw=${TEST_USER.PASSWORD}
... ocp_user_auth_type=${TEST_USER.AUTH_TYPE} dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME}
... browser_options=${BROWSER.OPTIONS}
Enable Anaconda ${ANACONDA_CE.ACTIVATION_KEY}
Capture Page Screenshot anaconda_success_activation.png
Menu.Navigate To Page Applications Enabled
Wait Until RHODS Dashboard Jupyter Is Visible
Capture Page Screenshot enabletab_anaconda_present.png
Verify Anaconda Card Present Based On Version
Go To ${OCP_CONSOLE_URL}
Open OCP Console
Login To Openshift ${OCP_ADMIN_USER.USERNAME} ${OCP_ADMIN_USER.PASSWORD} ${OCP_ADMIN_USER.AUTH_TYPE}
Maybe Skip Tour
${val_result}= Get Pod Logs From UI namespace=redhat-ods-applications
... pod_search_term=anaconda-ce-periodic-validator-job-custom-run
Log ${val_result}
Should Be Equal ${val_result[0]} ${VAL_SUCCESS_MSG}
Wait Until Keyword Succeeds 400 times 5s Check Anaconda CE Image Build Status Complete
Go To ${ODH_DASHBOARD_URL}
Login To RHODS Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Launch Dashboard ocp_user_name=${TEST_USER.USERNAME} ocp_user_pw=${TEST_USER.PASSWORD}
... ocp_user_auth_type=${TEST_USER.AUTH_TYPE} dashboard_url=${ODH_DASHBOARD_URL} browser=${BROWSER.NAME}
... browser_options=${BROWSER.OPTIONS}
Launch JupyterHub Spawner From Dashboard
Run Keyword And Continue On Failure Verify Anaconda Element Present Based On Version
Run Keyword And Continue On Failure Verify Anaconda Element Enabled Based On Version
Spawn Notebook With Arguments image=s2i-minimal-notebook-anaconda
Verify Git Plugin
Run Cell And Check Output !conda token set ${ANACONDA_CE.ACTIVATION_KEY} ${TOKEN_VAL_SUCCESS_MSG}
Capture Page Screenshot anaconda_token_val_cell.png
Add and Run JupyterLab Code Cell in Active Notebook !conda install -y numpy
Wait Until JupyterLab Code Cell Is Not Active
Run Cell And Check For Errors import numpy as np
Capture Page Screenshot conda_lib_install_result.png
Check condarc File Content
Install Numpy Package Should Fail
Validate Anaconda Token
Install Numpy Package Should Be Successful
Verify Library Version Is Greater Than jupyterlab 3.1.4
Verify Library Version Is Greater Than notebook 6.4.1
Maybe Open JupyterLab Sidebar File Browser
Expand All @@ -110,3 +107,37 @@ Verify Anaconda In Kfdef
END
END
Run Keyword And Continue On Failure Should Contain ${applications_names} anaconda-ce

Install Numpy Package Should Fail
[Documentation] Tries to install python package "numpy" and checks
... if the output matches the expected error message.
... The installation should fail because runs before token validation
${pkg_install_out}= Run Cell And Get Output !conda install -y numpy
${pkg_install_out}= Remove String Using Regexp ${pkg_install_out} ${\n}|${SPACE}
${PKG_INSTALL_ERROR_MSG}= Remove String Using Regexp ${PKG_INSTALL_ERROR_MSG} ${\n}|${SPACE}
Should Be Equal As Strings ${PKG_INSTALL_ERROR_MSG} ${pkg_install_out}

Validate Anaconda Token
[Documentation] Sets the token using "conda" command. It is necessary to start
... using the conda packages
Run Cell And Check Output !conda token set ${ANACONDA_CE.ACTIVATION_KEY} ${TOKEN_VAL_SUCCESS_MSG}
Capture Page Screenshot anaconda_token_val_cell.png

Install Numpy Package Should Be Successful
[Documentation] Tries to install python package "numpy" and checks
... if it runs without errors.
... The installation should be successful because runs after token validation
Add And Run JupyterLab Code Cell In Active Notebook !conda install -y numpy
Wait Until JupyterLab Code Cell Is Not Active
Run Cell And Check For Errors import numpy as np
Capture Page Screenshot conda_lib_install_result.png

Check condarc File Content
[Documentation] Checks the location and content of the "condarc" configuration file
${condarc_cat_out}= Run Cell And Get Output !cat /etc/conda/condarc
${condarc_cat_out}= Remove String Using Regexp ${condarc_cat_out} ${\n}|${SPACE}
${CONDARC_CAT_RESULT}= Remove String Using Regexp ${CONDARC_CAT_RESULT} ${\n}|${SPACE}
Should Be Equal As Strings ${CONDARC_CAT_RESULT} ${condarc_cat_out}
Run Keyword And Continue On Failure
... Run Cell And Check Output !cat $HOME/.condarc cat: /opt/app-root/src/.condarc: No such file or directory