Enable VS Code notebooks with a built-in SQL kernel. (#21995)

This commit is contained in:
Cory Rivera
2023-02-23 16:22:46 -08:00
committed by GitHub
parent 290687a207
commit f53119c2a6
66 changed files with 4962 additions and 318 deletions

View File

@@ -3,20 +3,16 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { join } from 'path';
import * as os from 'os';
import * as cp from 'child_process';
import { IElement, ILocalizedStrings, ILocaleInfo } from './driver';
import { launch as launchPlaywrightBrowser } from './playwrightBrowser';
import { launch as launchPlaywrightElectron } from './playwrightElectron';
import { Logger, measureAndLog } from './logger';
import { copyExtension } from './extensions';
import * as treekill from 'tree-kill';
import { teardown } from './processes';
import { PlaywrightDriver } from './playwrightDriver';
const rootPath = join(__dirname, '../../..');
export interface LaunchOptions {
codePath?: string;
readonly workspacePath: string;
@@ -75,8 +71,6 @@ export async function launch(options: LaunchOptions): Promise<Code> {
throw new Error('Smoke test process has terminated, refusing to spawn Code');
}
await measureAndLog(copyExtension(rootPath, options.extensionsPath, 'vscode-notebook-tests'), 'copyExtension(vscode-notebook-tests)', options.logger);
// Browser smoke tests
if (options.web) {
const { serverProcess, driver } = await measureAndLog(launchPlaywrightBrowser(options), 'launch playwright (browser)', options.logger);

View File

@@ -57,13 +57,6 @@ export async function resolveElectronConfiguration(options: LaunchOptions): Prom
const remoteDataDir = `${userDataDir}-server`;
mkdirp.sync(remoteDataDir);
if (codePath) {
// running against a build: copy the test resolver extension into remote extensions dir
const remoteExtensionsDir = join(remoteDataDir, 'extensions');
mkdirp.sync(remoteExtensionsDir);
await measureAndLog(copyExtension(root, remoteExtensionsDir, 'vscode-notebook-tests'), 'copyExtension(vscode-notebook-tests)', logger);
}
env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir;
env['TESTRESOLVER_LOGS_FOLDER'] = join(logsPath, 'server');
if (options.verbose) {
@@ -71,8 +64,6 @@ export async function resolveElectronConfiguration(options: LaunchOptions): Prom
}
}
args.push('--enable-proposed-api=vscode.vscode-notebook-tests');
if (!codePath) {
args.unshift(root);
}

View File

@@ -5,6 +5,7 @@
import { Code } from './code';
import { QuickAccess } from './quickaccess';
import { QuickInput } from './quickinput';
const activeRowSelector = `.notebook-editor .monaco-list-row.focused`;
@@ -12,11 +13,13 @@ export class Notebook {
constructor(
private readonly quickAccess: QuickAccess,
private readonly quickInput: QuickInput,
private readonly code: Code) {
}
async openNotebook() {
await this.quickAccess.runCommand('vscode-notebook-tests.createNewNotebook');
await this.quickAccess.openFileQuickAccessAndWait('notebook.ipynb', 1);
await this.quickInput.selectQuickInputElement(0);
await this.code.waitForElement(activeRowSelector);
await this.focusFirstCell();
await this.waitForActiveCellEditorContents('code()');

View File

@@ -103,7 +103,7 @@ export class Workbench {
this.addRemoteBookDialog = new AddRemoteBookDialog(code);
this.taskPanel = new TaskPanel(code, this.quickaccess);
// {{END}}
this.notebook = new Notebook(this.quickaccess, code);
this.notebook = new Notebook(this.quickaccess, this.quickinput, code);
this.localization = new Localization(code);
}
}