mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Enable VS Code notebooks with a built-in SQL kernel. (#21995)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()');
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user