Skip to content

Add is_dashboard_ready function + update unit test #318

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

Conversation

ChristianZaccaria
Copy link
Collaborator

@ChristianZaccaria ChristianZaccaria commented Aug 21, 2023

Issue link

Closes #314

What changes have been made

  • Added an is_dashboard_ready function that is used to check for the dashboard's availability. This is done by sending a request to the Dashboard URI, where if status code equals 200 we return True.
  • This new function is called within the wait_ready function to ensure that both the cluster and the dashboard are operational.

Verification steps

I updated the unit tests to reflect these changes on the wait_ready function. All tests are passing.

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests

@openshift-ci openshift-ci bot requested a review from MichaelClifford August 21, 2023 15:36
@ChristianZaccaria ChristianZaccaria force-pushed the update-wait-ready branch 2 times, most recently from f397cca to 53b4f98 Compare August 21, 2023 15:47
Copy link
Contributor

@Bobbins228 Bobbins228 left a comment

Choose a reason for hiding this comment

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

Tested changes and everything works as expected just two small nit picks with the cluster ready message

Comment on lines 222 to 228
try:
response = requests.get(self.cluster_dashboard_uri(), timeout=5)
if response.status_code == 200:
return True
except requests.RequestException:
pass
return False
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to be a try/except? requests.get() should always return some status_code, right?
Can we change it to be a bit simpler:

response = requests.get(self.cluster_dashboard_uri(), timeout=5)
if response.status_code == 200:
        return True
else:    
        return False

@Maxusmusti
Copy link
Collaborator

This will also need a rebase

@ChristianZaccaria ChristianZaccaria force-pushed the update-wait-ready branch 3 times, most recently from 06d7ffe to 926e7db Compare August 31, 2023 14:15
Copy link
Collaborator

@MichaelClifford MichaelClifford left a comment

Choose a reason for hiding this comment

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

lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 5, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MichaelClifford

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2023
@openshift-merge-robot openshift-merge-robot merged commit 9c95d6e into project-codeflare:main Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update wait_ready() behavior (or add a separate check for dashboard accessibility)
5 participants