Skip to content

Commit f3ead73

Browse files
Merge branch 'develop'
2 parents c9fabca + c23189a commit f3ead73

40 files changed

+1694
-946
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ Document some advanced types so users may try them out and provide feedback. The
1616

1717
- Read more in the extension documentation
1818

19+
## 4.5.1 - May 2024
20+
21+
Continuing with our story of IDL Notebook user experience, each session of notebook now gets it's own instance of IDL! This means a few things:
22+
23+
- You can now run more than one IDL Notebook in parallel! This makes it easy to crank through data or multi-task to your heart's content.
24+
25+
- Each session of IDL notebook is sand-boxed and a separate process. This means notebooks won't interact with each other.
26+
27+
- When you close an IDL Notebook, the associated IDL Kernel is automatically stopped
28+
29+
- A new sidebar entry in the Notebook section, allows you to stop all IDL Notebook Kernels
30+
31+
Remove a false error report when you stop IDL (terminate the process) while it is running
32+
33+
Fixed an error where we were not automatically returning from the main level when you compiled a main level program.
34+
35+
Fixed an issue in IDL Notebooks where, once ENVI is started, a notebook no longer can embed multiple graphics in a single notebook cell.
36+
37+
When ENVI is started, as long as the UI is not present, we now embed direct graphics. If the ENVI UI is open, we dont embed direct graphics.
38+
1939
## 4.5.0 - May 2024
2040

2141
New-and improved IDL Notebook user experience!

apps/client-e2e/src/tests/debugging/_debugging-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { VariableReplacement } from './variable-replacement';
2222
* Logger to be used for tests related to debugging
2323
*/
2424
// eslint-disable-next-line @typescript-eslint/no-empty-function
25-
export const DEBUG_TEST_LOGGER = new Logger('tests-debug', false, () => {});
25+
export const DEBUG_TEST_LOGGER = new Logger('debugging-tests', false, () => {});
2626

2727
/**
2828
* Test runner for debugging
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { GetExtensionPath, IDL_COMMANDS, Sleep } from '@idl/shared';
2+
import { OpenFileInVSCode } 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+
* Function that makes sure we return from main on compiling main
10+
*/
11+
export const ReturnFromMain: RunnerFunction = async (init) => {
12+
/**
13+
* Start IDL
14+
*/
15+
const started = await vscode.commands.executeCommand(
16+
IDL_COMMANDS.DEBUG.START
17+
);
18+
19+
// verify we started
20+
expect(started).toBeTruthy();
21+
22+
// close
23+
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
24+
25+
/** Get the file with timer callback */
26+
const file = GetExtensionPath(
27+
'idl/test/client-e2e/debug/return_from_main.pro'
28+
);
29+
30+
// open file
31+
await OpenFileInVSCode(file, true);
32+
33+
// short pause
34+
await Sleep(100);
35+
36+
// run
37+
const res = await vscode.commands.executeCommand(IDL_COMMANDS.DEBUG.RUN);
38+
39+
// make sure that we could run
40+
expect(res).toBeTruthy();
41+
42+
// get call stack
43+
const stack = (await init.debug.adapter._runtime.getCallStack()).frames.map(
44+
(item) => {
45+
return { line: item.line, file: item.file };
46+
}
47+
);
48+
49+
// make sure our call stack matches
50+
expect(stack).toEqual([{ line: 3, file }]);
51+
52+
// compile
53+
const recompile = await vscode.commands.executeCommand(
54+
IDL_COMMANDS.DEBUG.COMPILE
55+
);
56+
57+
// make sure that we could run
58+
expect(recompile).toBeTruthy();
59+
60+
// get call stack
61+
const stack2 = (await init.debug.adapter._runtime.getCallStack()).frames.map(
62+
(item) => {
63+
return { line: item.line, file: item.file };
64+
}
65+
);
66+
67+
// make sure our call stack matches
68+
expect(stack2).toEqual([{ line: 1, file }]);
69+
};

apps/client-e2e/src/tests/interactions/_interactions-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { TasksInteractRight } from './tasks-interact-right';
3333
* Logger to be used for tests related to debugging
3434
*/
3535
export const INTERACTIONS_TEST_LOGGER = new Logger(
36-
'tests-interaction',
36+
'interaction-tests',
3737
false,
3838
// eslint-disable-next-line @typescript-eslint/no-empty-function
3939
() => {}

apps/client-e2e/src/tests/notebooks/_notebook-runner.ts

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { NotebookFormats_1_0_0 } from './notebook-formats-1.0.0';
1010
import { NotebookFormats_2_0_0 } from './notebook-formats-2.0.0';
1111
import { RunNotebookReset } from './notebook-reset';
1212
import { RunNotebookStop } from './notebook-stop';
13+
import { RunNotebookStopAll } from './notebook-stop-all';
1314
import { NotebookToProCodeAllCells } from './notebook-to-pro-code-all-cells';
1415
import { NotebookToProCodeAllCells2 } from './notebook-to-pro-code-all-cells-2';
1516
import { NotebookToProCodeOnlyCode } from './notebook-to-pro-code-only-code';
@@ -20,6 +21,8 @@ import { OpenENVINotebookExample } from './open-envi-notebook-example';
2021
import { OpenIDLNotebookExample } from './open-idl-notebook-example';
2122
import { ResetNotebookExamples } from './reset-notebook-examples';
2223
import { RunENVIMessageListenerTestNotebook } from './run-envi-message-listener-test-notebook';
24+
import { RunENVIMultiPlotNotebook } from './run-envi-multi-plot-notebook';
25+
import { RunPlotRegressionNotebook } from './run-plot-regression-notebook';
2326
import { RunProblemNotebooks } from './run-problem-notebooks';
2427
import { RunTestENVIMapNotebook } from './run-test-envi-map-notebook';
2528
import { RunTestENVINotebook } from './run-test-envi-notebook';
@@ -32,7 +35,7 @@ import { VerifyQuietNotebookSetting } from './verify-quiet-notebook-setting';
3235
* Logger to be used for tests related to debugging
3336
*/
3437
export const NOTEBOOK_TEST_LOGGER = new Logger(
35-
'tests-notebook',
38+
'notebook-tests',
3639
false,
3740
// eslint-disable-next-line @typescript-eslint/no-empty-function
3841
() => {}
@@ -162,8 +165,25 @@ NOTEBOOK_RUNNER.addTest({
162165
],
163166
});
164167

168+
// can get multiple graphics when ENVI has started
165169
NOTEBOOK_RUNNER.addTest({
166-
name: 'Stack trace decorations on execution halted 1',
170+
name: 'Notebooks can display more than one plot when ENVI has started',
171+
fn: RunENVIMultiPlotNotebook,
172+
excludeOS: [
173+
{
174+
os: ['darwin'],
175+
architecture: ['arm', 'arm64'],
176+
},
177+
],
178+
});
179+
180+
NOTEBOOK_RUNNER.addTest({
181+
name: 'Regression test to re-embed graphics on property changes',
182+
fn: RunPlotRegressionNotebook,
183+
});
184+
185+
NOTEBOOK_RUNNER.addTest({
186+
name: 'Stack trace decorations on execution halted #1',
167187
fn: NotebookCallStackDecorationsOnExecutionHalted1,
168188
});
169189

@@ -204,6 +224,13 @@ NOTEBOOK_RUNNER.addTest({
204224
critical: true,
205225
});
206226

227+
// stop all notebooks
228+
NOTEBOOK_RUNNER.addTest({
229+
name: 'Stop all does the right thing',
230+
fn: RunNotebookStopAll,
231+
critical: true,
232+
});
233+
207234
// stop at the end to make sure the process exits
208235
NOTEBOOK_RUNNER.addTest({
209236
name: 'Stop does the right thing',

apps/client-e2e/src/tests/notebooks/helpers/run-notebook-and-check-call-stack-decorations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function RunNotebookAndCheckCallStackDecorations(
5252
await vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
5353

5454
// make sure launched
55-
expect(controller.isStarted()).toBeTruthy();
55+
expect(controller.isStarted(nb)).toBeTruthy();
5656

5757
// short pause based on the number of cells we have
5858
// sometimes the rendering takes too long to register (like complex maps)

apps/client-e2e/src/tests/notebooks/helpers/run-notebook-and-compare-cells.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function RunNotebookAndCompareCells(
4949
await vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
5050

5151
// make sure launched
52-
expect(controller.isStarted()).toBeTruthy();
52+
expect(controller.isStarted(nb)).toBeTruthy();
5353

5454
// short pause based on the number of cells we have
5555
// sometimes the rendering takes too long to register (like complex maps)

apps/client-e2e/src/tests/notebooks/notebook-reset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const RunNotebookReset: RunnerFunction = async (init) => {
3939
await vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
4040

4141
// make sure launched
42-
expect(init.notebooks.controller.isStarted()).toBeTruthy();
42+
expect(init.notebooks.controller.isStarted(nb)).toBeTruthy();
4343

4444
// trigger a run
4545
vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
@@ -54,7 +54,7 @@ export const RunNotebookReset: RunnerFunction = async (init) => {
5454
await Sleep(100);
5555

5656
// make sure stopped
57-
expect(init.notebooks.controller.isStarted()).toBeTruthy();
57+
expect(init.notebooks.controller.isStarted(nb)).toBeTruthy();
5858

5959
// compare state
6060
CompareCellOutputs(nb, CELL_OUTPUT);
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
};

apps/client-e2e/src/tests/notebooks/notebook-stop.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const RunNotebookStop: RunnerFunction = async (init) => {
3939
await vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
4040

4141
// make sure launched
42-
expect(init.notebooks.controller.isStarted()).toBeTruthy();
42+
expect(init.notebooks.controller.isStarted(nb)).toBeTruthy();
4343

4444
// trigger a run
4545
vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
@@ -54,7 +54,7 @@ export const RunNotebookStop: RunnerFunction = async (init) => {
5454
await Sleep(100);
5555

5656
// make sure stopped
57-
expect(init.notebooks.controller.isStarted()).toBeFalsy();
57+
expect(init.notebooks.controller.isStarted(nb)).toBeFalsy();
5858

5959
// compare state
6060
CompareCellOutputs(nb, CELL_OUTPUT);

0 commit comments

Comments
 (0)