mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 11:10:48 +00:00
restore integration test
This commit is contained in:
parent
b2b45e1005
commit
454b741257
1 changed files with 14 additions and 6 deletions
|
@ -68,11 +68,11 @@ class Kernel {
|
|||
|
||||
protected async _execute(cells: vscode.NotebookCell[]): Promise<void> {
|
||||
for (let cell of cells) {
|
||||
await this.#runCell(cell);
|
||||
await this._runCell(cell);
|
||||
}
|
||||
}
|
||||
|
||||
async #runCell(cell: vscode.NotebookCell) {
|
||||
protected async _runCell(cell: vscode.NotebookCell) {
|
||||
const task = this.controller.createNotebookCellExecutionTask(cell);
|
||||
task.start();
|
||||
task.executionOrder = 1;
|
||||
|
@ -174,6 +174,15 @@ suite('Notebook API tests', function () {
|
|||
this.controller.isPreferred = false;
|
||||
this.controller.hasExecutionOrder = false;
|
||||
}
|
||||
|
||||
override async _runCell(cell: vscode.NotebookCell) {
|
||||
const task = this.controller.createNotebookCellExecutionTask(cell);
|
||||
task.start();
|
||||
await task.replaceOutput([new vscode.NotebookCellOutput([
|
||||
new vscode.NotebookCellOutputItem('text/plain', ['my second output'], undefined)
|
||||
])]);
|
||||
task.end({ success: true });
|
||||
}
|
||||
};
|
||||
|
||||
testDisposables.push(kernel1.controller, kernel2.controller);
|
||||
|
@ -716,15 +725,14 @@ suite('Notebook API tests', function () {
|
|||
});
|
||||
|
||||
test('cell execute and select kernel', async function () {
|
||||
this.skip(); //todo@jrieken
|
||||
const resource = await createRandomFile('', undefined, '.vsctestnb');
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||
assert.strictEqual(vscode.window.activeNotebookEditor !== undefined, true, 'notebook first');
|
||||
const editor = vscode.window.activeNotebookEditor!;
|
||||
const cell = editor.document.cellAt(0);
|
||||
|
||||
vscode.commands.executeCommand('notebook.cell.execute');
|
||||
await withEvent<vscode.NotebookCellOutputsChangeEvent>(vscode.notebook.onDidChangeCellOutputs, async (event) => {
|
||||
await vscode.commands.executeCommand('notebook.cell.execute');
|
||||
await event;
|
||||
assert.strictEqual(cell.outputs.length, 1, 'should execute'); // runnable, it worked
|
||||
assert.strictEqual(cell.outputs[0].outputs.length, 1);
|
||||
|
@ -734,9 +742,9 @@ suite('Notebook API tests', function () {
|
|||
]);
|
||||
});
|
||||
|
||||
await vscode.commands.executeCommand('notebook.selectKernel', { extension: 'vscode.vscode-api-tests', id: 'secondaryKernel' });
|
||||
vscode.commands.executeCommand('notebook.cell.execute');
|
||||
await withEvent<vscode.NotebookCellOutputsChangeEvent>(vscode.notebook.onDidChangeCellOutputs, async (event) => {
|
||||
await vscode.commands.executeCommand('notebook.selectKernel', { extension: 'vscode.vscode-api-tests', id: 'secondaryKernel' });
|
||||
await vscode.commands.executeCommand('notebook.cell.execute');
|
||||
await event;
|
||||
assert.strictEqual(cell.outputs.length, 1, 'should execute'); // runnable, it worked
|
||||
assert.strictEqual(cell.outputs[0].outputs.length, 1);
|
||||
|
|
Loading…
Reference in a new issue