From 0421d73548e08430863b6cb4e4d3f9ead0edfd47 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 21 Nov 2019 12:47:04 -0800 Subject: [PATCH] Revert tests due to incompatibilities --- src/test/datascience/execution.unit.test.ts | 28 +++------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/test/datascience/execution.unit.test.ts b/src/test/datascience/execution.unit.test.ts index 1ac3fd491aa0..ecda0008bb31 100644 --- a/src/test/datascience/execution.unit.test.ts +++ b/src/test/datascience/execution.unit.test.ts @@ -280,7 +280,6 @@ suite('Jupyter Execution', async () => { }); teardown(() => { - reset(fileSystem); return cleanupDisposables(); }); @@ -440,7 +439,7 @@ suite('Jupyter Execution', async () => { .returns(() => result); } - function setupWorkingPythonService(service: TypeMoq.IMock, notebookStdErr?: string[], runInDocker?: boolean) { + function setupWorkingPythonService(service: TypeMoq.IMock, notebookStdErr?: string[]) { setupPythonService(service, 'ipykernel', ['--version'], Promise.resolve({ stdout: '1.1.1.1' })); setupPythonService(service, 'jupyter', ['nbconvert', '--version'], Promise.resolve({ stdout: '1.1.1.1' })); setupPythonService(service, 'jupyter', ['notebook', '--version'], Promise.resolve({ stdout: '1.1.1.1' })); @@ -463,8 +462,7 @@ suite('Jupyter Execution', async () => { const getServerInfoPath = path.join(EXTENSION_ROOT_DIR, 'pythonFiles', 'datascience', 'getServerInfo.py'); setupPythonService(service, undefined, [getServerInfoPath], Promise.resolve({ stdout: 'failure to get server infos' })); setupPythonServiceExecObservable(service, 'jupyter', ['kernelspec', 'list'], [], []); - const dockerArgs = runInDocker ? ['--ip', '127.0.0.1'] : []; - setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0', ...dockerArgs], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); + setupPythonServiceExecObservable(service, 'jupyter', ['notebook', '--no-browser', /--notebook-dir=.*/, /--config=.*/, '--NotebookApp.iopub_data_rate_limit=10000000000.0'], [], notebookStdErr ? notebookStdErr : ['http://localhost:8888/?token=198']); } function setupMissingKernelPythonService(service: TypeMoq.IMock, notebookStdErr?: string[]) { @@ -529,9 +527,6 @@ suite('Jupyter Execution', async () => { } function createExecution(activeInterpreter: PythonInterpreter, notebookStdErr?: string[], skipSearch?: boolean): JupyterExecutionFactory { - return createExecutionAndReturnProcessService(activeInterpreter, notebookStdErr, skipSearch).jupyterExecutionFactory; - } - function createExecutionAndReturnProcessService(activeInterpreter: PythonInterpreter, notebookStdErr?: string[], skipSearch?: boolean, runInDocker?: boolean): {workingPythonExecutionService: TypeMoq.IMock; jupyterExecutionFactory: JupyterExecutionFactory} { // Setup defaults when(interpreterService.onDidChangeInterpreter).thenReturn(dummyEvent.event); when(interpreterService.getActiveInterpreter()).thenResolve(activeInterpreter); @@ -540,12 +535,10 @@ suite('Jupyter Execution', async () => { when(interpreterService.getInterpreterDetails(match('/foo/baz/python.exe'))).thenResolve(missingKernelPython); when(interpreterService.getInterpreterDetails(match('/bar/baz/python.exe'))).thenResolve(missingNotebookPython); when(interpreterService.getInterpreterDetails(argThat(o => !o.includes || !o.includes('python')))).thenReject('Unknown interpreter'); - if (runInDocker){ - when(fileSystem.readFile('/proc/self/cgroup')).thenResolve('hello docker world'); - } + // Create our working python and process service. const workingService = createTypeMoq('working'); - setupWorkingPythonService(workingService, notebookStdErr, runInDocker); + setupWorkingPythonService(workingService, notebookStdErr); const missingKernelService = createTypeMoq('missingKernel'); setupMissingKernelPythonService(missingKernelService, notebookStdErr); const missingNotebookService = createTypeMoq('missingNotebook'); @@ -692,19 +685,6 @@ suite('Jupyter Execution', async () => { await assert.isFulfilled(execution.connectToNotebookServer(), 'Should be able to start a server'); }).timeout(10000); - test('Includes correct args for running in docker', async () => { - const { workingPythonExecutionService, jupyterExecutionFactory} = createExecutionAndReturnProcessService(workingPython, undefined, undefined, true); - when(executionFactory.createDaemon(deepEqual({ daemonModule: PythonDaemonModule, pythonPath: workingPython.path }))).thenResolve(workingPythonExecutionService.object); - - await assert.eventually.equal(jupyterExecutionFactory.isNotebookSupported(), true, 'Notebook not supported'); - await assert.eventually.equal(jupyterExecutionFactory.isImportSupported(), true, 'Import not supported'); - await assert.eventually.equal(jupyterExecutionFactory.isKernelSpecSupported(), true, 'Kernel Spec not supported'); - await assert.eventually.equal(jupyterExecutionFactory.isKernelCreateSupported(), true, 'Kernel Create not supported'); - const usableInterpreter = await jupyterExecutionFactory.getUsableJupyterPython(); - assert.isOk(usableInterpreter, 'Usable interpreter not found'); - await assert.isFulfilled(jupyterExecutionFactory.connectToNotebookServer(), 'Should be able to start a server'); - }).timeout(10000); - test('Failing notebook throws exception', async () => { const execution = createExecution(missingNotebookPython); when(interpreterService.getInterpreters()).thenResolve([missingNotebookPython]);