File tree Expand file tree Collapse file tree
apps/client-e2e/src/tests/notebooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { NotebookFormats_1_0_0 } from './notebook-formats-1.0.0';
1010import { NotebookFormats_2_0_0 } from './notebook-formats-2.0.0' ;
1111import { RunNotebookReset } from './notebook-reset' ;
1212import { RunNotebookStop } from './notebook-stop' ;
13+ import { RunNotebookStopAll } from './notebook-stop-all' ;
1314import { NotebookToProCodeAllCells } from './notebook-to-pro-code-all-cells' ;
1415import { NotebookToProCodeAllCells2 } from './notebook-to-pro-code-all-cells-2' ;
1516import { NotebookToProCodeOnlyCode } from './notebook-to-pro-code-only-code' ;
@@ -223,6 +224,13 @@ NOTEBOOK_RUNNER.addTest({
223224 critical : true ,
224225} ) ;
225226
227+ // stop all notebooks
228+ NOTEBOOK_RUNNER . addTest ( {
229+ name : 'Stop all does the right thing' ,
230+ fn : RunNotebookStopAll ,
231+ critical : true ,
232+ } ) ;
233+
226234// stop at the end to make sure the process exits
227235NOTEBOOK_RUNNER . addTest ( {
228236 name : 'Stop does the right thing' ,
Original file line number Diff line number Diff line change 1+ import { GetExtensionPath , IDL_COMMANDS , Sleep } from '@idl/shared' ;
2+ import { OpenNotebookInVSCode , VSCODE_COMMANDS } from '@idl/vscode/shared' ;
3+ import expect from 'expect' ;
4+ import * as vscode from 'vscode' ;
5+
6+ import { RunnerFunction } from '../runner.interface' ;
7+
8+ /**
9+ * Stop all notebooks
10+ */
11+ export const RunNotebookStopAll : RunnerFunction = async ( init ) => {
12+ /**
13+ * Get the file we are going to open
14+ */
15+ const file = GetExtensionPath (
16+ 'idl/test/client-e2e/notebooks/stop-notebook.idlnb'
17+ ) ;
18+
19+ /**
20+ * Open the notebook
21+ */
22+ const nb = await OpenNotebookInVSCode ( file ) ;
23+
24+ // trigger a run to start IDL
25+ await vscode . commands . executeCommand ( VSCODE_COMMANDS . NOTEBOOK_RUN_ALL ) ;
26+
27+ // make sure launched
28+ expect ( init . notebooks . controller . isStarted ( nb ) ) . toBeTruthy ( ) ;
29+
30+ // stop all notebooks
31+ await vscode . commands . executeCommand ( IDL_COMMANDS . NOTEBOOKS . STOP_ALL_KERNELS ) ;
32+
33+ // short pause
34+ await Sleep ( 500 ) ;
35+
36+ // make sure stopped
37+ expect ( init . notebooks . controller . isStarted ( nb ) ) . toBeFalsy ( ) ;
38+ } ;
You can’t perform that action at this time.
0 commit comments