From d6a58136dabf079c5fe3b297d2a535f7727e9387 Mon Sep 17 00:00:00 2001 From: Yurong He <43652751+YurongHe@users.noreply.github.com> Date: Tue, 26 Mar 2019 11:55:14 -0700 Subject: [PATCH] Add log to help debug failure in the lab (#4706) --- extensions/integration-tests/src/notebook.test.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/extensions/integration-tests/src/notebook.test.ts b/extensions/integration-tests/src/notebook.test.ts index cc6664fee9..cebb793f7e 100644 --- a/extensions/integration-tests/src/notebook.test.ts +++ b/extensions/integration-tests/src/notebook.test.ts @@ -16,24 +16,31 @@ import { getBdcServer } from './testConfig'; import { connectToServer } from './utils'; if (context.RunTest) { - suite('Notebook integration test suite', async () => { + suite('Notebook integration test suite', () => { test('Sql NB test', async function () { + console.log('Start Sql NB test'); let notebook = await openNotebook(sqlNotebookContent, sqlKernelMetadata); const expectedOutput0 = '(1 row affected)'; let cellOutputs = notebook.document.cells[0].contents.outputs; + console.log('Got cell outputs'); assert(cellOutputs.length === 3, `Expected length: 3, Acutal: '${cellOutputs.length}'`); let actualOutput0 = (cellOutputs[0]).data['text/html']; + console.log('Got first output'); assert(actualOutput0 === expectedOutput0, `Expected row count: '${expectedOutput0}', Acutal: '${actualOutput0}'`); let actualOutput2 = (cellOutputs[2]).data['application/vnd.dataresource+json'].data[0]; assert(actualOutput2[0] === '1', `Expected result: 1, Acutal: '${actualOutput2[0]}'`); + console.log('Sql NB done'); }); test('Python3 notebook test', async function () { + console.log('Start Python3 NB test'); let notebook = await openNotebook(pySparkNotebookContent, pythonKernelMetadata); let cellOutputs = notebook.document.cells[0].contents.outputs; + console.log('Got cell outputs'); let result = (cellOutputs[0]).data['text/plain']; assert(result === '2', `Expected: 2, Acutal: '${result}'`); + console.log('Python3 NB done'); }); // test('PySpark3 notebook test', async function () { @@ -52,10 +59,15 @@ async function openNotebook(content: azdata.nb.INotebookContents, kernelMetadata await connectToServer(server, 6000); let pythonNotebook = Object.assign({}, content, { metadata: kernelMetadata }); let uri = writeNotebookToFile(pythonNotebook); + console.log(uri); let notebook = await azdata.nb.showNotebookDocument(uri); + console.log('Notebook is opened'); assert(notebook.document.cells.length === 1, 'Notebook should have 1 cell'); + console.log('Before run notebook cell'); let ran = await notebook.runCell(notebook.document.cells[0]); + console.log('After run notebook cell'); assert(ran, 'Notebook runCell should succeed'); + assert(notebook !== undefined && notebook !== null, 'Expected notebook object is defined'); return notebook; }