Skip to content

Commit 925292a

Browse files
Fix unit tests by using JVSC_EXTENSION_ID instead of JVSC_EXTENSION_ID_FOR_TESTS
- Updated unit tests to use JVSC_EXTENSION_ID from constants instead of JVSC_EXTENSION_ID_FOR_TESTS - JVSC_EXTENSION_ID_FOR_TESTS is now correctly set to 'Deepnote.vscode-deepnote' for integration tests - This ensures unit tests match the runtime constant while integration tests can find the extension Co-Authored-By: Filip Pyrek <[email protected]>
1 parent 2b8ef59 commit 925292a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/kernels/execution/codeExecution.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from '@jupyterlab/services/lib/kernel/messages';
2222
import { Deferred, createDeferred } from '../../platform/common/utils/async';
2323
import { NotebookCellOutput, NotebookCellOutputItem } from 'vscode';
24-
import { JVSC_EXTENSION_ID_FOR_TESTS } from '../../test/constants';
24+
import { JVSC_EXTENSION_ID } from '../../platform/common/constants';
2525

2626
suite('Code Execution', () => {
2727
let disposables: IDisposable[] = [];
@@ -318,7 +318,7 @@ suite('Code Execution', () => {
318318
});
319319
test('Cancelling pending Internal Jupyter execution code should not interrupt the kernel', async () => {
320320
const code = `print('Hello World')`;
321-
const execution = createExecution(code, JVSC_EXTENSION_ID_FOR_TESTS);
321+
const execution = createExecution(code, JVSC_EXTENSION_ID);
322322

323323
const outputs: NotebookCellOutput[] = [];
324324
disposables.push(execution.onDidEmitOutput((output) => outputs.push(output)));

src/kernels/jupyter/finder/remoteKernelFinderController.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { IFileSystem } from '../../../platform/common/platform/types';
2727
import { RemoteKernelFinderController } from './remoteKernelFinderController';
2828
import { JupyterServerCollection, JupyterServerProvider } from '../../../api';
2929
import { UserJupyterServerPickerProviderId } from '../../../platform/constants';
30-
import { JVSC_EXTENSION_ID_FOR_TESTS } from '../../../test/constants';
30+
import { JVSC_EXTENSION_ID } from '../../../platform/common/constants';
3131

3232
suite(`Remote Kernel Finder Controller`, () => {
3333
let disposables: Disposable[] = [];
@@ -50,7 +50,7 @@ suite(`Remote Kernel Finder Controller`, () => {
5050
provider: {
5151
id: UserJupyterServerPickerProviderId,
5252
handle: '2',
53-
extensionId: JVSC_EXTENSION_ID_FOR_TESTS
53+
extensionId: JVSC_EXTENSION_ID
5454
}
5555
};
5656
let serverUriStorage: IJupyterServerUriStorage;
@@ -127,7 +127,7 @@ suite(`Remote Kernel Finder Controller`, () => {
127127
const collectionForRemote = mock<JupyterServerCollection>();
128128
when(collectionForRemote.id).thenReturn(UserJupyterServerPickerProviderId);
129129
when(collectionForRemote.label).thenReturn('Quick Label');
130-
when(collectionForRemote.extensionId).thenReturn(JVSC_EXTENSION_ID_FOR_TESTS);
130+
when(collectionForRemote.extensionId).thenReturn(JVSC_EXTENSION_ID);
131131
const serverProvider = mock<JupyterServerProvider>();
132132
when(serverProvider.provideJupyterServers(anything())).thenResolve();
133133
when(collectionForRemote.serverProvider).thenReturn(instance(serverProvider));

src/standalone/api/kernels/kernel.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { createMockedNotebookDocument } from '../../../test/datascience/editor-i
3131
import { IControllerRegistration, IVSCodeNotebookController } from '../../../notebooks/controllers/types';
3232
import { createKernelApiForExtension } from './kernel';
3333
import { noop } from '../../../test/core';
34-
import { JVSC_EXTENSION_ID_FOR_TESTS } from '../../../test/constants';
34+
import { JVSC_EXTENSION_ID } from '../../../platform/common/constants';
3535
import { IKernelConnection } from '@jupyterlab/services/lib/kernel/kernel';
3636
import { NotebookCellOutput } from 'vscode';
3737

@@ -127,7 +127,7 @@ suite('Kernel Api', () => {
127127
when(kernel.shutdown()).thenResolve();
128128
when(kernel.dispose()).thenCall(() => when(kernel.status).thenReturn('dead'));
129129

130-
const { api } = createKernelApiForExtension(JVSC_EXTENSION_ID_FOR_TESTS, instance(kernel));
130+
const { api } = createKernelApiForExtension(JVSC_EXTENSION_ID, instance(kernel));
131131
// eslint-disable-next-line @typescript-eslint/no-unused-vars
132132
for await (const _ of api.executeCode('bogus', token)) {
133133
//

src/test/constants.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const EXTENSION_TEST_DIR_FOR_FILES = path.join(
1616
'datascience',
1717
'temp'
1818
);
19-
export const JVSC_EXTENSION_ID_FOR_TESTS = 'ms-toolsai.jupyter';
19+
export const JVSC_EXTENSION_ID_FOR_TESTS = 'Deepnote.vscode-deepnote';
2020

2121
export const SMOKE_TEST_EXTENSIONS_DIR = path.join(
2222
EXTENSION_ROOT_DIR_FOR_TESTS,

src/test/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
export const JVSC_EXTENSION_ID_FOR_TESTS = 'ms-toolsai.jupyter';
4+
export const JVSC_EXTENSION_ID_FOR_TESTS = 'Deepnote.vscode-deepnote';
55
export const PerformanceExtensionId = 'ms-toolsai.vscode-notebook-perf';
66

77
export type TestSettingsType = {

0 commit comments

Comments
 (0)