@@ -280,7 +280,6 @@ suite('Jupyter Execution', async () => {
280
280
} ) ;
281
281
282
282
teardown ( ( ) => {
283
- reset ( fileSystem ) ;
284
283
return cleanupDisposables ( ) ;
285
284
} ) ;
286
285
@@ -440,7 +439,7 @@ suite('Jupyter Execution', async () => {
440
439
. returns ( ( ) => result ) ;
441
440
}
442
441
443
- function setupWorkingPythonService ( service : TypeMoq . IMock < IPythonExecutionService > , notebookStdErr ?: string [ ] , runInDocker ?: boolean ) {
442
+ function setupWorkingPythonService ( service : TypeMoq . IMock < IPythonExecutionService > , notebookStdErr ?: string [ ] ) {
444
443
setupPythonService ( service , 'ipykernel' , [ '--version' ] , Promise . resolve ( { stdout : '1.1.1.1' } ) ) ;
445
444
setupPythonService ( service , 'jupyter' , [ 'nbconvert' , '--version' ] , Promise . resolve ( { stdout : '1.1.1.1' } ) ) ;
446
445
setupPythonService ( service , 'jupyter' , [ 'notebook' , '--version' ] , Promise . resolve ( { stdout : '1.1.1.1' } ) ) ;
@@ -463,8 +462,7 @@ suite('Jupyter Execution', async () => {
463
462
const getServerInfoPath = path . join ( EXTENSION_ROOT_DIR , 'pythonFiles' , 'datascience' , 'getServerInfo.py' ) ;
464
463
setupPythonService ( service , undefined , [ getServerInfoPath ] , Promise . resolve ( { stdout : 'failure to get server infos' } ) ) ;
465
464
setupPythonServiceExecObservable ( service , 'jupyter' , [ 'kernelspec' , 'list' ] , [ ] , [ ] ) ;
466
- const dockerArgs = runInDocker ? [ '--ip' , '127.0.0.1' ] : [ ] ;
467
- setupPythonServiceExecObservable ( service , 'jupyter' , [ 'notebook' , '--no-browser' , / - - n o t e b o o k - d i r = .* / , / - - c o n f i g = .* / , '--NotebookApp.iopub_data_rate_limit=10000000000.0' , ...dockerArgs ] , [ ] , notebookStdErr ? notebookStdErr : [ 'http://localhost:8888/?token=198' ] ) ;
465
+ setupPythonServiceExecObservable ( service , 'jupyter' , [ 'notebook' , '--no-browser' , / - - n o t e b o o k - d i r = .* / , / - - c o n f i g = .* / , '--NotebookApp.iopub_data_rate_limit=10000000000.0' ] , [ ] , notebookStdErr ? notebookStdErr : [ 'http://localhost:8888/?token=198' ] ) ;
468
466
}
469
467
470
468
function setupMissingKernelPythonService ( service : TypeMoq . IMock < IPythonExecutionService > , notebookStdErr ?: string [ ] ) {
@@ -529,9 +527,6 @@ suite('Jupyter Execution', async () => {
529
527
}
530
528
531
529
function createExecution ( activeInterpreter : PythonInterpreter , notebookStdErr ?: string [ ] , skipSearch ?: boolean ) : JupyterExecutionFactory {
532
- return createExecutionAndReturnProcessService ( activeInterpreter , notebookStdErr , skipSearch ) . jupyterExecutionFactory ;
533
- }
534
- function createExecutionAndReturnProcessService ( activeInterpreter : PythonInterpreter , notebookStdErr ?: string [ ] , skipSearch ?: boolean , runInDocker ?: boolean ) : { workingPythonExecutionService : TypeMoq . IMock < IPythonExecutionService > ; jupyterExecutionFactory : JupyterExecutionFactory } {
535
530
// Setup defaults
536
531
when ( interpreterService . onDidChangeInterpreter ) . thenReturn ( dummyEvent . event ) ;
537
532
when ( interpreterService . getActiveInterpreter ( ) ) . thenResolve ( activeInterpreter ) ;
@@ -540,12 +535,10 @@ suite('Jupyter Execution', async () => {
540
535
when ( interpreterService . getInterpreterDetails ( match ( '/foo/baz/python.exe' ) ) ) . thenResolve ( missingKernelPython ) ;
541
536
when ( interpreterService . getInterpreterDetails ( match ( '/bar/baz/python.exe' ) ) ) . thenResolve ( missingNotebookPython ) ;
542
537
when ( interpreterService . getInterpreterDetails ( argThat ( o => ! o . includes || ! o . includes ( 'python' ) ) ) ) . thenReject ( 'Unknown interpreter' ) ;
543
- if ( runInDocker ) {
544
- when ( fileSystem . readFile ( '/proc/self/cgroup' ) ) . thenResolve ( 'hello docker world' ) ;
545
- }
538
+
546
539
// Create our working python and process service.
547
540
const workingService = createTypeMoq < IPythonExecutionService > ( 'working' ) ;
548
- setupWorkingPythonService ( workingService , notebookStdErr , runInDocker ) ;
541
+ setupWorkingPythonService ( workingService , notebookStdErr ) ;
549
542
const missingKernelService = createTypeMoq < IPythonExecutionService > ( 'missingKernel' ) ;
550
543
setupMissingKernelPythonService ( missingKernelService , notebookStdErr ) ;
551
544
const missingNotebookService = createTypeMoq < IPythonExecutionService > ( 'missingNotebook' ) ;
@@ -692,19 +685,6 @@ suite('Jupyter Execution', async () => {
692
685
await assert . isFulfilled ( execution . connectToNotebookServer ( ) , 'Should be able to start a server' ) ;
693
686
} ) . timeout ( 10000 ) ;
694
687
695
- test ( 'Includes correct args for running in docker' , async ( ) => {
696
- const { workingPythonExecutionService, jupyterExecutionFactory} = createExecutionAndReturnProcessService ( workingPython , undefined , undefined , true ) ;
697
- when ( executionFactory . createDaemon ( deepEqual ( { daemonModule : PythonDaemonModule , pythonPath : workingPython . path } ) ) ) . thenResolve ( workingPythonExecutionService . object ) ;
698
-
699
- await assert . eventually . equal ( jupyterExecutionFactory . isNotebookSupported ( ) , true , 'Notebook not supported' ) ;
700
- await assert . eventually . equal ( jupyterExecutionFactory . isImportSupported ( ) , true , 'Import not supported' ) ;
701
- await assert . eventually . equal ( jupyterExecutionFactory . isKernelSpecSupported ( ) , true , 'Kernel Spec not supported' ) ;
702
- await assert . eventually . equal ( jupyterExecutionFactory . isKernelCreateSupported ( ) , true , 'Kernel Create not supported' ) ;
703
- const usableInterpreter = await jupyterExecutionFactory . getUsableJupyterPython ( ) ;
704
- assert . isOk ( usableInterpreter , 'Usable interpreter not found' ) ;
705
- await assert . isFulfilled ( jupyterExecutionFactory . connectToNotebookServer ( ) , 'Should be able to start a server' ) ;
706
- } ) . timeout ( 10000 ) ;
707
-
708
688
test ( 'Failing notebook throws exception' , async ( ) => {
709
689
const execution = createExecution ( missingNotebookPython ) ;
710
690
when ( interpreterService . getInterpreters ( ) ) . thenResolve ( [ missingNotebookPython ] ) ;
0 commit comments