mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
Starting Fewer Jupyter Servers for Notebooks (#7744)
* Start fewer Jupyter servers * Windows fix for drive casing * PR Feedback * Quick fix * Fixing bug * Ensure environment variables set 4 session startup * test fix * Dummy commit to update comment
This commit is contained in:
@@ -11,7 +11,7 @@ import 'mocha';
|
||||
|
||||
import { JupyterServerInstallation } from '../../jupyter/jupyterServerInstallation';
|
||||
import { ApiWrapper } from '../..//common/apiWrapper';
|
||||
import { PerNotebookServerInstance, ServerInstanceUtils } from '../../jupyter/serverInstance';
|
||||
import { PerFolderServerInstance, ServerInstanceUtils } from '../../jupyter/serverInstance';
|
||||
import { MockOutputChannel } from '../common/stubs';
|
||||
import * as testUtils from '../common/testUtils';
|
||||
import { LocalJupyterServerManager } from '../../jupyter/jupyterServerManager';
|
||||
@@ -27,7 +27,7 @@ describe('Jupyter server instance', function (): void {
|
||||
let mockOutputChannel: TypeMoq.IMock<MockOutputChannel>;
|
||||
let mockApiWrapper: TypeMoq.IMock<ApiWrapper>;
|
||||
let mockUtils: TypeMoq.IMock<ServerInstanceUtils>;
|
||||
let serverInstance: PerNotebookServerInstance;
|
||||
let serverInstance: PerFolderServerInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
mockApiWrapper = TypeMoq.Mock.ofType(ApiWrapper);
|
||||
@@ -40,7 +40,7 @@ describe('Jupyter server instance', function (): void {
|
||||
mockInstall.object.execOptions = { env: Object.assign({}, process.env) };
|
||||
mockUtils = TypeMoq.Mock.ofType(ServerInstanceUtils);
|
||||
mockUtils.setup(u => u.ensureProcessEnded(TypeMoq.It.isAny())).returns(() => undefined);
|
||||
serverInstance = new PerNotebookServerInstance({
|
||||
serverInstance = new PerFolderServerInstance({
|
||||
documentPath: expectedPath,
|
||||
install: mockInstall.object
|
||||
}, mockUtils.object);
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('Jupyter Session Manager', function (): void {
|
||||
mockJupyterManager.setup(m => m.startNew(TypeMoq.It.isAny())).returns(() => Promise.resolve(expectedSessionInfo));
|
||||
|
||||
// When I call startSession
|
||||
let session = await sessionManager.startNew(sessionOptions);
|
||||
let session = await sessionManager.startNew(sessionOptions, true);
|
||||
// Then I expect the parameters passed to be correct
|
||||
should(session.path).equal(sessionOptions.path);
|
||||
should(session.canChangeKernels).be.true();
|
||||
@@ -147,7 +147,7 @@ describe('Jupyter Session', function (): void {
|
||||
kernel = session.kernel;
|
||||
// Then I expect it to have the ID, and only be called once
|
||||
should(kernel.id).equal('id');
|
||||
mockJupyterSession.verify(s => s.kernel, TypeMoq.Times.once());
|
||||
mockJupyterSession.verify(s => s.kernel, TypeMoq.Times.exactly(2));
|
||||
});
|
||||
|
||||
it('should send name in changeKernel request', async function (): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user