Skip to content

Commit 85e0344

Browse files
committed
Add tests
1 parent 2bdf6f1 commit 85e0344

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/test/datascience/interactiveWindow.vscode.common.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ suite(`Interactive window execution`, async function () {
104104
assert.equal(actualSource, source, `Executed cell has unexpected source code`);
105105
await waitForExecutionCompletedSuccessfully(secondCell!);
106106
await waitForTextOutput(secondCell!, '42');
107+
108+
// If we're connected to a remote kernel,
109+
// then ensure the kernel points to a live connection.
110+
if (IS_REMOTE_NATIVE_TEST()) {
111+
assert.strictEqual(
112+
controllerSelection.getSelected(notebookDocument!)?.connection.kind,
113+
'connectToLiveRemoteKernel'
114+
);
115+
}
107116
});
108117
test('__file__ exists even after restarting a kernel', async function () {
109118
// Ensure we click `Yes` when prompted to restart the kernel.

src/test/datascience/notebook/remoteNotebookEditor.vscode.common.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import { setIntellisenseTimeout } from '../../../standalone/intellisense/pythonK
3535
import {
3636
IControllerDefaultService,
3737
IControllerLoader,
38-
IControllerRegistration
38+
IControllerRegistration,
39+
IControllerSelection
3940
} from '../../../notebooks/controllers/types';
4041

4142
/* eslint-disable @typescript-eslint/no-explicit-any, no-invalid-this */
@@ -157,6 +158,13 @@ suite('DataScience - VSCode Notebook - Remote Execution', function () {
157158
await insertCodeCell('print("123412341234")', { index: 0 });
158159
const cell = vscodeNotebook.activeNotebookEditor?.notebook.cellAt(0)!;
159160
await Promise.all([runCell(cell), waitForTextOutput(cell, '123412341234')]);
161+
162+
// Ensure the kernel points to a live connection.
163+
const controllerSelection = api.serviceManager.get<IControllerSelection>(IControllerSelection);
164+
assert.strictEqual(
165+
controllerSelection.getSelected(vscodeNotebook.activeNotebookEditor!.notebook!)?.connection.kind,
166+
'connectToLiveRemoteKernel'
167+
);
160168
});
161169

162170
test('Remote kernels support completions', async function () {

0 commit comments

Comments
 (0)