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-11156: chore(tests/containers/jupyterlab): check that the JuyterLab index.html contains the spinner code #874

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jiridanek
Copy link
Member

@jiridanek jiridanek commented Jan 29, 2025

https://issues.redhat.com/browse/RHOAIENG-11156

Description

How Has This Been Tested?

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from harshad16 and jstourac January 29, 2025 10:32
Copy link
Contributor

openshift-ci bot commented Jan 29, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jiridanek. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 size/m and removed size/m labels Jan 29, 2025
response = requests.get(f"http://{host_ip}:{host_port}/notebook/opendatahub/jovyan")
assert response.status_code == 200
assert "text/html" in response.headers["content-type"]
assert 'class="pf-v6-c-spinner"' in response.text
Copy link
Member

Choose a reason for hiding this comment

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

too pitty we didn't put some testid attribute to this our extra element against which we could check here...

"--ServerApp.quit_button=False",
"""--ServerApp.tornado_settings={"user":"jovyan","hub_host":"https://opendatahub.io","hub_prefix":"/notebookController/jovyan"}"""]))
try:
# we changed base_url, and wait_for_readiness=True would attempt connections to /
Copy link
Member

Choose a reason for hiding this comment

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

Could you please clarify, why we need to override the default base URL here?

Copy link
Member Author

Choose a reason for hiding this comment

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

because when jupyterlab is started with --ServerApp.base_url=/notebook/opendatahub/jovyan, accessing / will give you 404, and you need to go to /notebook/opendatahub/jovyan to get a 200 response

and starting jupyterlab without the jupyterlab options will not give you the page with spinner, but some welcome screen where it instructs you how to set tokens to connect

I guess I could've just disabled password and ignored all the other options, but I decided to use all the options dashboard normally starts the workbench with

Copy link
Member

Choose a reason for hiding this comment

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

Hm, I see now; thanks for the explanation! It would be nice to put some brief explanation into the description too, if you don't mind; but I don't insist.

Copy link
Member Author

@jiridanek jiridanek Jan 29, 2025

Choose a reason for hiding this comment

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

@jstourac
Copy link
Member

Based on the linked CI you provided - shall I understand it that the test is expected to pass in all of our Jupyter images despite the [comment in this jira|https://issues.redhat.com/browse/RHOAIENG-11156?focusedId=26491161&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-26491161]? Based on the description in https://issues.redhat.com/browse/RHOAIENG-18915 - shall I understand it so that the fix worked and we simply didn't propagate it fully to the current 2.17 release, is that my assumption correct?

@jiridanek
Copy link
Member Author

Based on the description in https://issues.redhat.com/browse/RHOAIENG-18915 - shall I understand it so that the fix worked and we simply didn't propagate it fully to the current 2.17 release, is that my assumption correct?

When I ran this on the image from our 2.17 release, the test failed for me

podman pull quay.io/modh/rocm-notebooks@sha256:69b82475cadb537aa212cb0be6535d918ed5f7d2413057abede143a2753a01f9
DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock poetry run pytest tests/containers/workbenches/jupyterlab --image quay.io/modh/rocm-notebooks@sha256:69b82475cadb537aa212cb0be6535d918ed5f7d2413057abede143a2753a01f9

the pytest command above gives me

FAILED tests/containers/workbenches/jupyterlab/jupyterlab_test.py::TestJupyterLabImage::test_spinner_html_loaded[quay.io/modh/rocm-notebooks@sha256:69b82475cadb537aa212cb0be6535d918ed5f7d2413057abede143a2753a01f9] - assert 'class="pf-v6-c-spinner"' in '<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JupyterLab</title><meta name="viewport" content="width=device-width,initial-scale=1">   <script id="jupyter-conf...

@jstourac
Copy link
Member

When I ran this on the image from our 2.17 release, the test failed for me

This means yes to my question/assumption, correct?

…pyterLab index.html contains the spinner code
@jiridanek
Copy link
Member Author

This means yes to my question/assumption, correct?

Yes, at least, that's also how I understand it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants