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

RHOAIENG-5435 - Distributed Workloads Components #1392

Conversation

mattmahoneyrh
Copy link
Contributor

@mattmahoneyrh mattmahoneyrh commented Apr 17, 2024

Included are test cases for DSC Distributed Workloads Components Ray, Codeflare and Kueue, tests Manage/Remove management states.

These components are restored to original management state.

@mattmahoneyrh mattmahoneyrh added needs testing Needs to be tested in Jenkins new test New test(s) added (PR will be listed in release-notes) labels Apr 17, 2024
@@ -220,7 +220,7 @@
[Documentation] Checks there are no errors on Pod Logs
[Arguments] ${pod_name} ${pod_namespace} ${regex_pattern} ${container}
${pod_logs}= Oc Get Pod Logs name=${pod_name} namespace=${pod_namespace} container=${container}
${match_list} Get Regexp Matches ${pod_logs} ${regex_pattern}
${match_list} Get Regexp Matches ${pod_logs} ${regex_pattern}

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning test

The assignment sign is not consistent within the file. Expected '=' but got '' instead
ods_ci/tests/Resources/ODS.robot Fixed Show fixed Hide fixed
ods_ci/tests/Resources/ODS.robot Fixed Show fixed Hide fixed
ods_ci/tests/Resources/ODS.robot Fixed Show fixed Hide fixed
ods_ci/tests/Resources/ODS.robot Fixed Show fixed Hide fixed

[Tags] Operator Tier1 RHOAIENG-5435 codeflare-removed

Set DSC Component Removed State And Wait For Completion codeflare ${CODEFLARE_DEPLOYMENT_NAME} ${CODEFLARE_LABEL_SELECTOR}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (134/120)
Copy link
Contributor

github-actions bot commented Apr 17, 2024

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass %
454 0 0 454 100

@mattmahoneyrh
Copy link
Contributor Author

Passed on jekins / RHOAI.

@mattmahoneyrh mattmahoneyrh removed the needs testing Needs to be tested in Jenkins label Apr 17, 2024
jiripetrlik
jiripetrlik previously approved these changes Apr 19, 2024
[Arguments] ${dsc} ${component} ${namespace}

${rc} ${state}= Run And Return Rc And Output
... oc get DataScienceCluster/${dsc} -n ${namespace} -o 'jsonpath={.spec.components.${component}.managementState}'

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning

The assignment sign is not consistent within the file. Expected ' =' but got '=' instead
Get DSC Component State
[Documentation] Get component management state
[Arguments] ${dsc} ${component} ${namespace}

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning

The assignment sign is not consistent within the file. Expected ' =' but got '=' instead
${rc} ${out}= Run And Return Rc And Output
... oc wait --timeout=${wait_time} --for jsonpath='{.status.conditions[].reason}'=ReconcileCompleted -n ${namespace} dsc ${dsc_name} # robocop: disable
Should Be Equal As Integers ${rc} ${0}
Log ${out} console=${out}

Check warning

Code scanning / Robocop

File has too many lines ({{ lines_count }}/{{max_allowed_count }}) Warning test

File has too many lines (413/400)
... check that kueue deployment and pod are created
[Tags] Operator Tier1 RHOAIENG-5435 kueue-managed

Set DSC Component Managed State And Wait For Completion kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (122/120)
${current_state}= Get DSC Component State ${DSC_NAME} ${component} ${OPERATOR_NS}
IF "${current_state}" != "${saved_state}"
IF "${saved_state}" == "Managed"
Set DSC Component Managed State And Wait For Completion ${component} ${deployment_name} ${LABEL_SELECTOR}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (126/120)
IF "${saved_state}" == "Managed"
Set DSC Component Managed State And Wait For Completion ${component} ${deployment_name} ${LABEL_SELECTOR}
ELSE IF "${saved_state}" == "Removed"
Set DSC Component Removed State And Wait For Completion ${component} ${deployment_name} ${LABEL_SELECTOR}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (126/120)
@mattmahoneyrh mattmahoneyrh added the needs testing Needs to be tested in Jenkins label Apr 25, 2024
asanzgom
asanzgom previously approved these changes Apr 25, 2024
@mattmahoneyrh mattmahoneyrh added verified This PR has been tested with Jenkins and removed needs testing Needs to be tested in Jenkins labels Apr 25, 2024
@mattmahoneyrh
Copy link
Contributor Author

@jstourac @bdattoma Would you be able to review the feedback updates, so that we can get these new tests merged?

[Documentation] Get component management state
[Arguments] ${dsc} ${component} ${namespace}

${rc} ${state}= Run And Return Rc And Output

Check warning

Code scanning / Robocop

The assignment sign is not consistent within the file. Expected '{{ expected_sign }}' but got '{{ actual_sign }}' instead Warning

The assignment sign is not consistent within the file. Expected ' =' but got '=' instead
[Arguments] ${dsc} ${component} ${namespace}

${rc} ${state}= Run And Return Rc And Output
... oc get DataScienceCluster/${dsc} -n ${namespace} -o 'jsonpath={.spec.components.${component}.managementState}'

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning

Line is too long (121/120)
${RAY_DEPLOYMENT_NAME} kuberay-operator
${IS_PRESENT} 0
${IS_NOT_PRESENT} 1
&{SAVED_MANATEMENT_STATES}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to rename it to SAVED_MANAGEMENT_STATES?


Set DSC Component Managed State And Wait For Completion kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR}

[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANATEMENT_STATES.RAY}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANATEMENT_STATES.RAY}
[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANATEMENT_STATES.KUEUE}

?


Set DSC Component Removed State And Wait For Completion kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR}

[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANATEMENT_STATES.RAY}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANATEMENT_STATES.RAY}
[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANATEMENT_STATES.KUEUE}

?


Validate Codeflare Managed State
[Documentation] Validate that the DSC by default sets component 'Codeflare' to sate Managed,
... check that kueue deployment and pod are created
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really kueue?

Copy link
Member

@jstourac jstourac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put some comments 🙂

@bdattoma
Copy link
Contributor

bdattoma commented May 6, 2024

apart from @jstourac comments, lgtm


Set DSC Component Managed State And Wait For Completion kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR}

[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.KUEUE}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (146/120)

Set DSC Component Removed State And Wait For Completion kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR}

[Teardown] Restore DSC Component State kueue ${KUEUE_DEPLOYMENT_NAME} ${KUEUE_LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.KUEUE}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (146/120)

Set DSC Component Managed State And Wait For Completion ray ${RAY_DEPLOYMENT_NAME} ${RAY_LABEL_SELECTOR}

[Teardown] Restore DSC Component State ray ${RAY_DEPLOYMENT_NAME} ${RAY_LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.RAY}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (138/120)

Set DSC Component Removed State And Wait For Completion ray ${RAY_DEPLOYMENT_NAME} ${RAY_LABEL_SELECTOR}

[Teardown] Restore DSC Component State ray ${RAY_DEPLOYMENT_NAME} ${RAY_LABEL_SELECTOR} ${SAVED_MANAGEMENT_STATES.RAY}

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (138/120)
[Documentation] Suite Setup
RHOSi Setup
Wait For DSC Conditions Reconciled ${OPERATOR_NS} ${DSC_NAME}
${SAVED_MANAGEMENT_STATES.RAY}= Get DSC Component State ${DSC_NAME} ray ${OPERATOR_NS}

Check notice

Code scanning / Robocop

Variable '{{ name }}' is assigned but not used Note test

Variable '${SAVED_MANAGEMENT_STATES.RAY}' is assigned but not used
RHOSi Setup
Wait For DSC Conditions Reconciled ${OPERATOR_NS} ${DSC_NAME}
${SAVED_MANAGEMENT_STATES.RAY}= Get DSC Component State ${DSC_NAME} ray ${OPERATOR_NS}
${SAVED_MANAGEMENT_STATES.KUEUE}= Get DSC Component State ${DSC_NAME} kueue ${OPERATOR_NS}

Check notice

Code scanning / Robocop

Variable '{{ name }}' is assigned but not used Note test

Variable '${SAVED_MANAGEMENT_STATES.KUEUE}' is assigned but not used
Wait For DSC Conditions Reconciled ${OPERATOR_NS} ${DSC_NAME}
${SAVED_MANAGEMENT_STATES.RAY}= Get DSC Component State ${DSC_NAME} ray ${OPERATOR_NS}
${SAVED_MANAGEMENT_STATES.KUEUE}= Get DSC Component State ${DSC_NAME} kueue ${OPERATOR_NS}
${SAVED_MANAGEMENT_STATES.CODEFLARE}= Get DSC Component State ${DSC_NAME} codeflare ${OPERATOR_NS}

Check notice

Code scanning / Robocop

Variable '{{ name }}' is assigned but not used Note test

Variable '${SAVED_MANAGEMENT_STATES.CODEFLARE}' is assigned but not used
${SAVED_MANAGEMENT_STATES.RAY}= Get DSC Component State ${DSC_NAME} ray ${OPERATOR_NS}
${SAVED_MANAGEMENT_STATES.KUEUE}= Get DSC Component State ${DSC_NAME} kueue ${OPERATOR_NS}
${SAVED_MANAGEMENT_STATES.CODEFLARE}= Get DSC Component State ${DSC_NAME} codeflare ${OPERATOR_NS}
Set Suite Variable ${SAVED_MANAGEMENT_STATES}

Check notice

Code scanning / Robocop

{{ set_variable_keyword }} can be replaced with VAR Note test

Set Suite Variable can be replaced with VAR
@mattmahoneyrh
Copy link
Contributor Author

mattmahoneyrh commented May 7, 2024

Addressed latest feedback.
Tests passed in Jenkins.

fyi @jstourac

@mattmahoneyrh mattmahoneyrh requested review from asanzgom and jstourac May 7, 2024 17:33
Copy link

sonarqubecloud bot commented May 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@asanzgom asanzgom merged commit 34ff049 into red-hat-data-services:master May 8, 2024
8 checks passed
@mattmahoneyrh mattmahoneyrh deleted the RHOAIENG-5435_Distributed_Workloads_Components branch May 28, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new test New test(s) added (PR will be listed in release-notes) verified This PR has been tested with Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants