mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 (#14883)
* Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 * Bump distro * Upgrade GCC to 4.9 due to yarn install errors * Update build image * Fix bootstrap base url * Bump distro * Fix build errors * Update source map file * Disable checkbox for blocking migration issues (#15131) * disable checkbox for blocking issues * wip * disable checkbox fixes * fix strings * Remove duplicate tsec command * Default to off for tab color if settings not present * re-skip failing tests * Fix mocha error * Bump sqlite version & fix notebooks search view * Turn off esbuild warnings * Update esbuild log level * Fix overflowactionbar tests * Fix ts-ignore in dropdown tests * cleanup/fixes * Fix hygiene * Bundle in entire zone.js module * Remove extra constructor param * bump distro for web compile break * bump distro for web compile break v2 * Undo log level change * New distro * Fix integration test scripts * remove the "no yarn.lock changes" workflow * fix scripts v2 * Update unit test scripts * Ensure ads-kerberos2 updates in .vscodeignore * Try fix unit tests * Upload crash reports * remove nogpu * always upload crashes * Use bash script * Consolidate data/ext dir names * Create in tmp directory Co-authored-by: chlafreniere <hichise@gmail.com> Co-authored-by: Christopher Suh <chsuh@microsoft.com> Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
@@ -51,6 +51,10 @@ export class Application {
|
||||
return !!this.options.remote;
|
||||
}
|
||||
|
||||
get web(): boolean {
|
||||
return !!this.options.web;
|
||||
}
|
||||
|
||||
private _workspacePathOrFolder: string;
|
||||
get workspacePathOrFolder(): string {
|
||||
return this._workspacePathOrFolder;
|
||||
@@ -149,7 +153,7 @@ export class Application {
|
||||
await this.code.waitForElement('.monaco-workbench');
|
||||
|
||||
if (this.remote) {
|
||||
await this.code.waitForTextContent('.monaco-workbench .statusbar-item[id="status.host"]', ' TestResolver');
|
||||
await this.code.waitForTextContent('.monaco-workbench .statusbar-item[id="status.host"]', ' TestResolver', undefined, 2000);
|
||||
}
|
||||
|
||||
// wait a bit, since focus might be stolen off widgets
|
||||
|
||||
@@ -120,7 +120,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
let child: cp.ChildProcess | undefined;
|
||||
let connectDriver: typeof connectElectronDriver;
|
||||
|
||||
copyExtension(options, 'vscode-notebook-tests');
|
||||
copyExtension(options.extensionsPath, 'vscode-notebook-tests');
|
||||
|
||||
if (options.web) {
|
||||
await launch(options.userDataDir, options.workspacePath, options.codePath, options.extensionsPath);
|
||||
@@ -150,11 +150,19 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
|
||||
if (codePath) {
|
||||
// running against a build: copy the test resolver extension
|
||||
copyExtension(options, 'vscode-test-resolver');
|
||||
copyExtension(options.extensionsPath, 'vscode-test-resolver');
|
||||
}
|
||||
args.push('--enable-proposed-api=vscode.vscode-test-resolver');
|
||||
const remoteDataDir = `${options.userDataDir}-server`;
|
||||
mkdirp.sync(remoteDataDir);
|
||||
|
||||
if (codePath) {
|
||||
// running against a build: copy the test resolver extension into remote extensions dir
|
||||
const remoteExtensionsDir = path.join(remoteDataDir, 'extensions');
|
||||
mkdirp.sync(remoteExtensionsDir);
|
||||
copyExtension(remoteExtensionsDir, 'vscode-notebook-tests');
|
||||
}
|
||||
|
||||
env['TESTRESOLVER_DATA_FOLDER'] = remoteDataDir;
|
||||
}
|
||||
|
||||
@@ -186,11 +194,11 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
|
||||
return connect(connectDriver, child, outPath, handle, options.logger);
|
||||
}
|
||||
|
||||
async function copyExtension(options: SpawnOptions, extId: string): Promise<void> {
|
||||
const testResolverExtPath = path.join(options.extensionsPath, extId);
|
||||
if (!fs.existsSync(testResolverExtPath)) {
|
||||
async function copyExtension(extensionsPath: string, extId: string): Promise<void> {
|
||||
const dest = path.join(extensionsPath, extId);
|
||||
if (!fs.existsSync(dest)) {
|
||||
const orig = path.join(repoPath, 'extensions', extId);
|
||||
await new Promise((c, e) => ncp(orig, testResolverExtPath, err => err ? e(err) : c()));
|
||||
await new Promise((c, e) => ncp(orig, dest, err => err ? e(err) : c()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +290,7 @@ export class Code {
|
||||
await this.driver.exitApplication();
|
||||
}
|
||||
|
||||
async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number): Promise<string> { // {{SQL CARBON EDIT}} Add retryCount
|
||||
async waitForTextContent(selector: string, textContent?: string, accept?: (result: string) => boolean, retryCount?: number): Promise<string> {
|
||||
const windowId = await this.getActiveWindowId();
|
||||
accept = accept || (result => textContent !== undefined ? textContent === result : !!result);
|
||||
|
||||
@@ -290,7 +298,7 @@ export class Code {
|
||||
() => this.driver.getElements(windowId, selector).then(els => els.length > 0 ? Promise.resolve(els[0].textContent) : Promise.reject(new Error('Element not found for textContent'))),
|
||||
s => accept!(typeof s === 'string' ? s : ''),
|
||||
`get text content '${selector}'`,
|
||||
retryCount // {{SQL CARBON EDIT}} Add retryCount
|
||||
retryCount
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ export class Extensions extends Viewlet {
|
||||
await this.code.waitAndClick(SEARCH_BOX);
|
||||
await this.code.waitForActiveElement(SEARCH_BOX);
|
||||
await this.code.waitForTypeInEditor(SEARCH_BOX, `@id:${id}`);
|
||||
await this.code.waitForElement(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`);
|
||||
}
|
||||
|
||||
async openExtension(id: string): Promise<any> {
|
||||
await this.searchForExtension(id);
|
||||
await this.code.waitAndClick(`div.extensions-viewlet[id="workbench.view.extensions"] .monaco-list-row[data-extension-id="${id}"]`);
|
||||
}
|
||||
|
||||
async installExtension(id: string, waitUntilEnabled: boolean): Promise<void> {
|
||||
|
||||
@@ -11,7 +11,7 @@ export class KeybindingsEditor {
|
||||
|
||||
constructor(private code: Code) { }
|
||||
|
||||
async updateKeybinding(command: string, keybinding: string, title: string): Promise<any> {
|
||||
async updateKeybinding(command: string, commandName: string | undefined, keybinding: string, keybindingTitle: string): Promise<any> {
|
||||
if (process.platform === 'darwin') {
|
||||
await this.code.dispatchKeybinding('cmd+k cmd+s');
|
||||
} else {
|
||||
@@ -19,16 +19,16 @@ export class KeybindingsEditor {
|
||||
}
|
||||
|
||||
await this.code.waitForActiveElement(SEARCH_INPUT);
|
||||
await this.code.waitForSetValue(SEARCH_INPUT, command);
|
||||
await this.code.waitForSetValue(SEARCH_INPUT, `@command:${command}`);
|
||||
|
||||
await this.code.waitAndClick('.keybindings-list-container .monaco-list-row.keybinding-item');
|
||||
await this.code.waitForElement('.keybindings-list-container .monaco-list-row.keybinding-item.focused.selected');
|
||||
const commandTitle = commandName ? `${commandName} (${command})` : command;
|
||||
await this.code.waitAndClick(`.keybindings-list-container .monaco-list-row.keybinding-item .command span.monaco-highlighted-label[title="${commandTitle}"]`);
|
||||
await this.code.waitForElement(`.keybindings-list-container .monaco-list-row.keybinding-item.focused.selected .command span.monaco-highlighted-label[title="${commandTitle}"]`);
|
||||
await this.code.dispatchKeybinding('enter');
|
||||
|
||||
await this.code.waitAndClick('.keybindings-list-container .monaco-list-row.keybinding-item .action-item .codicon-keybindings-add');
|
||||
await this.code.waitForActiveElement('.defineKeybindingWidget .monaco-inputbox input');
|
||||
|
||||
await this.code.dispatchKeybinding(keybinding);
|
||||
await this.code.dispatchKeybinding('enter');
|
||||
await this.code.waitForElement(`.keybindings-list-container .keybinding-label div[title="${title}"]`);
|
||||
await this.code.waitForElement(`.keybindings-list-container .keybinding-label div[title="${keybindingTitle}"]`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ export async function launch(userDataDir: string, _workspacePath: string, codeSe
|
||||
VSCODE_REMOTE_SERVER_PATH: codeServerPath,
|
||||
...process.env
|
||||
};
|
||||
const args = ['--browser', 'none', '--driver', 'web', '--extensions-dir', extPath];
|
||||
let serverLocation: string | undefined;
|
||||
if (codeServerPath) {
|
||||
serverLocation = join(codeServerPath, `server.${process.platform === 'win32' ? 'cmd' : 'sh'}`);
|
||||
@@ -114,7 +115,7 @@ export async function launch(userDataDir: string, _workspacePath: string, codeSe
|
||||
}
|
||||
server = spawn(
|
||||
serverLocation,
|
||||
['--browser', 'none', '--driver', 'web', '--extensions-dir', extPath],
|
||||
args,
|
||||
{ env }
|
||||
);
|
||||
server.stderr?.on('data', error => console.log(`Server stderr: ${error}`));
|
||||
|
||||
Reference in New Issue
Block a user