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

Write terminado tests #13

Open
yuvipanda opened this issue Oct 27, 2020 · 0 comments · May be fixed by #21
Open

Write terminado tests #13

yuvipanda opened this issue Oct 27, 2020 · 0 comments · May be fixed by #21

Comments

@yuvipanda
Copy link
Owner

yuvipanda commented Oct 27, 2020

Jupyter uses the terminado
package to provide terminal access in the GUI. We use its JSON API
to provide terminal access via ssh - this way, we can provide terminal
access to any JupyterHub, without depending on implementation details

  • like kubernetes or container requirements.

jupyterhub_ssh/terminado.py is a class that's a client for
terminado. This should be able to talk to any terminado server,
running in a plain Jupyter Notebook. We should write simple tests
that:

  1. Start a jupyter notebook
  2. Talk to the terminado endpoint there
  3. Verify that things work as they should!

Things we should test:

  1. Authorization works via token, fails without
  2. Sending stdin works fine. We can do this by sending something like
    touch <random-generated-id>\n to the shell, and verifying that the
    file was created.
  3. Fetching stdout works fine. We could do this by sending a commend
    via stdin like echo <random-generated-id>\n and testing that we
    see that in stdout.
  4. Setting size on the terminal (via set_size) is reflected fine in
    the backend. This reflects the row and column size used by TUI
    applications - like emacs, vim, top, etc. Once set_size is sent,
    you can validate the new size by running tput cols and tput lines.
  5. Terminal servers are started when needed, and whenever disconnects /
    issues happen, they are cleaned up properly. We shouldn't leave
    random terminado servers running. We can test this by hitting the
    notebook API ourselves and testing.

Would be nice to document the protocol too - I don't think there's
public documentation of this JSON protocol.

@GeorgianaElena GeorgianaElena linked a pull request Oct 29, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant