Skip to content

Commit e31bfca

Browse files
authored
Re-enabled some of the skipped notebook tests (microsoft#255087)
* Identify flaky test failures * Updates
1 parent c195156 commit e31bfca

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

extensions/vscode-api-tests/src/singlefolder-tests/ipynb.test.ts

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,40 @@
66
import * as assert from 'assert';
77
import 'mocha';
88
import * as vscode from 'vscode';
9+
import { assertNoRpc, closeAllEditors, createRandomFile } from '../utils';
10+
11+
const ipynbContent = JSON.stringify({
12+
"cells": [
13+
{
14+
"cell_type": "markdown",
15+
"source": ["## Header"],
16+
"metadata": {}
17+
},
18+
{
19+
"cell_type": "code",
20+
"execution_count": 2,
21+
"source": ["print('hello 1')\n", "print('hello 2')"],
22+
"outputs": [
23+
{
24+
"output_type": "stream",
25+
"name": "stdout",
26+
"text": ["hello 1\n", "hello 2\n"]
27+
}
28+
],
29+
"metadata": {}
30+
}
31+
]
32+
});
33+
34+
suite('ipynb NotebookSerializer', function () {
35+
teardown(async function () {
36+
assertNoRpc();
37+
await closeAllEditors();
38+
});
939

10-
(vscode.env.uiKind === vscode.UIKind.Web ? suite.skip : suite)('ipynb NotebookSerializer', function () {
1140
test('Can open an ipynb notebook', async () => {
12-
assert.ok(vscode.workspace.workspaceFolders);
13-
const workspace = vscode.workspace.workspaceFolders[0];
14-
const uri = vscode.Uri.joinPath(workspace.uri, 'test.ipynb');
15-
const notebook = await vscode.workspace.openNotebookDocument(uri);
41+
const file = await createRandomFile(ipynbContent, undefined, '.ipynb');
42+
const notebook = await vscode.workspace.openNotebookDocument(file);
1643
await vscode.window.showNotebookDocument(notebook);
1744

1845
const notebookEditor = vscode.window.activeNotebookEditor;

extensions/vscode-api-tests/src/singlefolder-tests/notebook.kernel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const apiTestSerializer: vscode.NotebookSerializer = {
123123
}
124124
};
125125

126-
(vscode.env.uiKind === vscode.UIKind.Web ? suite.skip : suite)('Notebook Kernel API tests', function () {
126+
suite('Notebook Kernel API tests', function () {
127127

128128
const testDisposables: vscode.Disposable[] = [];
129129
const suiteDisposables: vscode.Disposable[] = [];

0 commit comments

Comments
 (0)