-
Notifications
You must be signed in to change notification settings - Fork 293
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
Remote jupyter connections in Native Nb to same degree as webviews #4390
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4390 +/- ##
======================================
- Coverage 75% 75% -1%
======================================
Files 392 396 +4
Lines 25746 25861 +115
Branches 3680 3710 +30
======================================
+ Hits 19407 19488 +81
- Misses 4826 4845 +19
- Partials 1513 1528 +15
|
a2de18b
to
ed7e122
Compare
@@ -469,7 +469,7 @@ jobs: | |||
python: [3.8] # Use flaky tests to run against more versions of Python. | |||
# integration: Tests with VS Code, Python extension & real Jupyter | |||
# notebook: Notebook Tests with VS Code, Python extension & real Jupyter | |||
test-suite: [integration, notebook, notebookWithoutPythonExt, conda] | |||
test-suite: [integration, notebook, remoteNotebook, notebookWithoutPythonExt, conda] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run native notebook tests with remote jupyter as a separate job (faster & easier to manage)
.vscode/launch.json
Outdated
@@ -209,6 +209,7 @@ | |||
"VSC_JUPYTER_RUN_NB_TEST": "true", // Initialize this to run notebook tests (must be using VSC Insiders). | |||
"VSC_JUPYTER_LOAD_EXPERIMENTS_FROM_FILE": "true", | |||
"TEST_FILES_SUFFIX": "vscode.test", | |||
"XVSC_JUPYTER_REMOTE_NATIVE_TEST": "1", // Remove 'X' prefix to run the Native Notebook tests with remote jupyter connections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ability to run remote jupyter locally
selection.interpreter = await this.kernelService.findMatchingInterpreter(selection.kernelSpec); | ||
} | ||
selection.interpreter = item.selection.interpreter || (await activeInterpreter); | ||
if (isPythonKernelConnection(selection)) { | ||
selection.kernelSpec.interpreterPath = | ||
selection.kernelSpec.interpreterPath || selection.interpreter?.path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a bug while testing, we weren't setting this
* @param {Kernel.IKernelConnection} kernel | ||
* @memberof KernelSelector | ||
*/ | ||
public addKernelToIgnoreList(kernel: Kernel.IKernelConnection): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from KernelSelector class to this so that it can be used by NativeNotebooks (this class is already used by native notebooks as it doesn't have UI specific code)
@inject(IPythonExtensionChecker) private readonly extensionChecker: IPythonExtensionChecker, | ||
@inject(PreferredRemoteKernelIdProvider) | ||
private readonly preferredRemoteKernelIdProvider: PreferredRemoteKernelIdProvider | ||
) { | ||
disposableRegistry.push( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this code to another class.
@@ -52,6 +52,35 @@ export class JupyterServerSelector { | |||
const multiStep = this.multiStepFactory.create<{}>(); | |||
return multiStep.run(this.startSelectingURI.bind(this, allowLocal), {}); | |||
} | |||
@captureTelemetry(Telemetry.SetJupyterURIToLocal) | |||
public async setJupyterURIToLocal(): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public to enable setting these in tests, else no changes to this file
} | ||
} | ||
|
||
public async setJupyterURIToRemote(userURI: string): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public to enable setting these in tests, else no changes to this file
} | ||
}); | ||
disposeHandler = kernel.onDisposed(() => { | ||
if (disposeHandler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added code to ensure we dispose the handlers (clean up code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending status & test fixes.
0384fe0
to
d7b2571
Compare
@@ -681,6 +679,7 @@ jobs: | |||
VSC_JUPYTER_FORCE_LOGGING: 1 | |||
VSC_PYTHON_FORCE_LOGGING: 1 | |||
VSC_JUPYTER_CI_RUN_NON_PYTHON_NB_TEST: 1 | |||
VSC_JUPYTER_REMOTE_NATIVE_TEST: ${{ contains(matrix.test-suite, 'remote') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks @rchiodo
8275bcd
to
bc8ad9f
Compare
For #254
@rchiodo @IanMatthewHuff @joyceerhl @DavidKutu
Testing is hanging, will fix that (tests work locally).
Else ready for review.
Damn, forgot to display the Uri of the server in status bar