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

Testing Jupyter Extension API #14368

Closed
6 of 14 tasks
DonJayamanne opened this issue Sep 26, 2023 · 5 comments
Closed
6 of 14 tasks

Testing Jupyter Extension API #14368

DonJayamanne opened this issue Sep 26, 2023 · 5 comments

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Sep 26, 2023

Refs: #13894

Complexity: 5

Authors: @DonJayamanne

Create Issue


Steps

Things to try:

  • Review the API and contribute a new item for the Kernel Picker
  • Verify it shows up in the kernel picker along with Python Environments, Jupyter Kernels, Existing Jupyter Server
  • Contribute Jupyter Servers (with ids and lables) and verify they show up in the quick pick upon selecting the newly contributed item
  • Verify the documentation in the API is clear enough.
  • Trigger the onDidChangeServers event and verify the new Servers are displayed in the quick pick
  • Create at least two commands and verify they are displayed in the quick pick
    • Verify selecting each command ends up calling the handleCommand with the right arguments.
  • Create only one command and ensure there are no servers
    • Upon selecting your server from the kernel picker, verify the command is automatically selected.

@rebornix

  • Verify you are able to select a valid Jupyter Kernel from the extension you build
  • Verify you are able to execute a cell from the kernel selected
  • Reload VS Code and verify the same kernel is auto selected in the kernel picker
  • Go into the kernel picker and verify the server is now listed with a date/time for the last connection
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug testplan-item and removed bug Issue identified by VS Code Team member as probable bug labels Sep 26, 2023
@DonJayamanne DonJayamanne added this to the September 2023 milestone Sep 26, 2023
@ghost ghost assigned rebornix and amunger Sep 26, 2023
@amunger
Copy link
Contributor

amunger commented Sep 26, 2023

    /**
     * Information required to Connect to the Jupyter Server.
     * This can be eagerly provided by the extension or lazily provided by the extension.
     * For instance of the authentication mechanism is straight forward (e.g. token based), then the extension can provide this information eagerly.
     * Else then information required to connect to the server will be retrieved via {@link JupyterServerProvider.resolveJupyterServer}.
     */
    readonly connectionInformation?: JupyterServerConnectionInformation;

could be shortened to

    /**
     * Information required to Connect to the Jupyter Server.
     * This can be eagerly provided during {@link JupyterServerProvider.provideJupyterServers}
     * or lazily via {@link JupyterServerProvider.resolveJupyterServer}.
     */
    readonly connectionInformation?: JupyterServerConnectionInformation;

@rebornix
Copy link
Member

It's working as expected, great work! I have moved my Docker Connect extension to the new API and it's seamless. 👏

The only challenge with my Docker Connect extension is mapping directory, I found a couple of issues with how it works (from my understanding the new mapping didn't get https://github.com/microsoft/vscode-jupyter/pull/12446/files#r1058626552 resolved unfortunately) but we can discuss later.

@rebornix rebornix removed their assignment Sep 26, 2023
@amunger
Copy link
Contributor

amunger commented Sep 26, 2023

I'm not sure what should be in the value parameter here, isn't the value entered just my Server Provider that they selected? It seemed to be undefined when I tried using it.

    /**
     * Returns a list of commands to be displayed to the user.
     * @param value The value entered by the user in the quick pick.
     */
    provideCommands(value: string | undefined, token: CancellationToken): ProviderResult<JupyterServerCommand[]>;

@amunger
Copy link
Contributor

amunger commented Sep 26, 2023

It also wasn't totally clear to me where commands were going to show up (along with my provided servers, or after selecting one), but it was easy enough to add a dummy command to find out. Totally makes sense how it works once I got the hang of it.

@amunger
Copy link
Contributor

amunger commented Sep 26, 2023

pretty nice

Recording 2023-09-26 at 13 13 30

@amunger amunger removed their assignment Sep 26, 2023
@amunger amunger closed this as completed Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants