Skip to content

Commit 6cbd231

Browse files
Add extra test to make sure stop works right
1 parent 1100c52 commit 6cbd231

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ NOTEBOOK_RUNNER.addTest({
210210
});
211211

212212
NOTEBOOK_RUNNER.addTest({
213-
name: 'Replace cell paths for stops',
213+
name: 'Replace cell paths for stops and make sure stop always works',
214214
fn: NotebooksReplaceCellPathsOnStop,
215215
});
216216

apps/client-e2e/src/tests/notebooks/notebooks-replace-cell-paths-on-stop.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,21 @@ import * as vscode from 'vscode';
77

88
import { CLIENT_E2E_CONFIG } from '../client-e2e-config.interface';
99
import { RunnerFunction } from '../runner.interface';
10+
import { CompareCellOutputs } from './helpers/compare-cells';
11+
import { ICompareCellOutputs } from './helpers/compare-cells.interface';
1012
import { CompareNotebookJSONOutputs } from './helpers/compare-notebook-json-outputs';
1113

14+
/**
15+
* Types of outputs from cells that we expect to have
16+
*/
17+
export const CELL_OUTPUT: ICompareCellOutputs[] = [
18+
{
19+
idx: 0,
20+
success: false,
21+
mimeTypes: ['text/plain'],
22+
},
23+
];
24+
1225
/**
1326
* Verifies we replace paths when we stop
1427
*/
@@ -36,6 +49,34 @@ export const NotebooksReplaceCellPathsOnStop: RunnerFunction = async (init) => {
3649
// wait
3750
await Sleep(CLIENT_E2E_CONFIG.DELAYS.PROBLEMS_NOTEBOOK);
3851

52+
// compare cells
53+
await CompareCellOutputs(nb, CELL_OUTPUT);
54+
55+
/**
56+
* ==================================================================
57+
* Run all cells again and compare the outputs to make sure
58+
* we catch stopping right
59+
* ==================================================================
60+
*/
61+
62+
// run all cells
63+
await vscode.commands.executeCommand(VSCODE_COMMANDS.NOTEBOOK_RUN_ALL);
64+
65+
// save to disk
66+
await nb.save();
67+
68+
// wait
69+
await Sleep(CLIENT_E2E_CONFIG.DELAYS.PROBLEMS_NOTEBOOK);
70+
71+
// compare cells
72+
await CompareCellOutputs(nb, CELL_OUTPUT);
73+
74+
/**
75+
* ==================================================================
76+
* Make sure JSON paths match
77+
* ==================================================================
78+
*/
79+
3980
// compare outputs
4081
await CompareNotebookJSONOutputs(expectedUri, nbUri);
4182

0 commit comments

Comments
 (0)