From 4ddcaaf670494b75ccf9326e824fae3de46a82d7 Mon Sep 17 00:00:00 2001 From: aamunger Date: Mon, 25 Mar 2024 15:01:08 -0700 Subject: [PATCH 1/2] enable IW smoke test --- src/test/smoke/datascience.smoke.test.ts | 54 ++++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/test/smoke/datascience.smoke.test.ts b/src/test/smoke/datascience.smoke.test.ts index f17f3e855ac..3c6bd13c83a 100644 --- a/src/test/smoke/datascience.smoke.test.ts +++ b/src/test/smoke/datascience.smoke.test.ts @@ -8,7 +8,7 @@ import * as fs from 'fs-extra'; import * as path from '../../platform/vscode-path/path'; import * as vscode from 'vscode'; import { traceInfo, traceVerbose } from '../../platform/logging'; -import { PYTHON_PATH, setAutoSaveDelayInWorkspaceRoot, waitForCondition } from '../common.node'; +import { PYTHON_PATH, openFile, setAutoSaveDelayInWorkspaceRoot, waitForCondition } from '../common.node'; import { EXTENSION_ROOT_DIR_FOR_TESTS, IS_SMOKE_TEST } from '../constants.node'; import { sleep } from '../core'; import { closeActiveWindows, initialize, initializeTest } from '../initialize.node'; @@ -41,32 +41,32 @@ suite('Smoke Tests', function () { traceInfo(`End Test Complete ${this.currentTest?.title}`); }); - // test('Run Cell in interactive window', async () => { - // const file = path.join( - // EXTENSION_ROOT_DIR_FOR_TESTS, - // 'src', - // 'test', - // 'pythonFiles', - // 'datascience', - // 'simple_note_book.py' - // ); - // const outputFile = path.join(path.dirname(file), 'ds.log'); - // if (await fs.pathExists(outputFile)) { - // await fs.unlink(outputFile); - // } - // const textDocument = await openFile(file); - - // // Wait for code lenses to get detected. - // console.log('Step0'); - // await sleep(1_000); - // console.log('Step1'); - // await vscode.commands.executeCommand('jupyter.runallcells', textDocument.uri); - // console.log('Step2'); - // const checkIfFileHasBeenCreated = () => fs.pathExists(outputFile); - // console.log('Step3'); - // await waitForCondition(checkIfFileHasBeenCreated, timeoutForCellToRun, `"${outputFile}" file not created`); - // console.log('Step4'); - // }).timeout(timeoutForCellToRun); + test('Run Cell in interactive window', async () => { + const file = path.join( + EXTENSION_ROOT_DIR_FOR_TESTS, + 'src', + 'test', + 'pythonFiles', + 'datascience', + 'simple_note_book.py' + ); + const outputFile = path.join(path.dirname(file), 'ds.log'); + if (await fs.pathExists(outputFile)) { + await fs.unlink(outputFile); + } + const textDocument = await openFile(file); + + // Wait for code lenses to get detected. + console.log('Step0'); + await sleep(1_000); + console.log('Step1'); + await vscode.commands.executeCommand('jupyter.runallcells', textDocument.uri); + console.log('Step2'); + const checkIfFileHasBeenCreated = () => fs.pathExists(outputFile); + console.log('Step3'); + await waitForCondition(checkIfFileHasBeenCreated, timeoutForCellToRun, `"${outputFile}" file not created`); + console.log('Step4'); + }).timeout(timeoutForCellToRun); test('Run Cell in Notebook', async function () { const file = path.join( From 6e80b1cea2ecda4c47cad6caf6b3f496500ea2d8 Mon Sep 17 00:00:00 2001 From: aamunger Date: Mon, 25 Mar 2024 15:04:52 -0700 Subject: [PATCH 2/2] update test name --- src/test/smoke/datascience.smoke.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/smoke/datascience.smoke.test.ts b/src/test/smoke/datascience.smoke.test.ts index 3c6bd13c83a..1ceecffe9be 100644 --- a/src/test/smoke/datascience.smoke.test.ts +++ b/src/test/smoke/datascience.smoke.test.ts @@ -41,7 +41,7 @@ suite('Smoke Tests', function () { traceInfo(`End Test Complete ${this.currentTest?.title}`); }); - test('Run Cell in interactive window', async () => { + test('Run all Cells in interactive window', async () => { const file = path.join( EXTENSION_ROOT_DIR_FOR_TESTS, 'src',