mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Merge vscode 1.67 (#20883)
* Fix initial build breaks from 1.67 merge (#2514) * Update yarn lock files * Update build scripts * Fix tsconfig * Build breaks * WIP * Update yarn lock files * Misc breaks * Updates to package.json * Breaks * Update yarn * Fix breaks * Breaks * Build breaks * Breaks * Breaks * Breaks * Breaks * Breaks * Missing file * Breaks * Breaks * Breaks * Breaks * Breaks * Fix several runtime breaks (#2515) * Missing files * Runtime breaks * Fix proxy ordering issue * Remove commented code * Fix breaks with opening query editor * Fix post merge break * Updates related to setup build and other breaks (#2516) * Fix bundle build issues * Update distro * Fix distro merge and update build JS files * Disable pipeline steps * Remove stats call * Update license name * Make new RPM dependencies a warning * Fix extension manager version checks * Update JS file * Fix a few runtime breaks * Fixes * Fix runtime issues * Fix build breaks * Update notebook tests (part 1) * Fix broken tests * Linting errors * Fix hygiene * Disable lint rules * Bump distro * Turn off smoke tests * Disable integration tests * Remove failing "activate" test * Remove failed test assertion * Disable other broken test * Disable query history tests * Disable extension unit tests * Disable failing tasks
This commit is contained in:
@@ -15,9 +15,9 @@ export interface IExternalTerminalSettings {
|
||||
}
|
||||
|
||||
export interface ITerminalForPlatform {
|
||||
windows: string,
|
||||
linux: string,
|
||||
osx: string
|
||||
windows: string;
|
||||
linux: string;
|
||||
osx: string;
|
||||
}
|
||||
|
||||
export interface IExternalTerminalService {
|
||||
@@ -29,7 +29,7 @@ export interface IExternalTerminalService {
|
||||
|
||||
export interface IExternalTerminalConfiguration {
|
||||
terminal: {
|
||||
explorerKind: 'integrated' | 'external',
|
||||
explorerKind: 'integrated' | 'external';
|
||||
external: IExternalTerminalSettings;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,63 +3,51 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { deepEqual, equal } from 'assert';
|
||||
import { DEFAULT_TERMINAL_OSX } from 'vs/platform/externalTerminal/common/externalTerminal';
|
||||
import { deepStrictEqual, strictEqual } from 'assert';
|
||||
import { DEFAULT_TERMINAL_OSX, IExternalTerminalConfiguration } from 'vs/platform/externalTerminal/common/externalTerminal';
|
||||
import { LinuxExternalTerminalService, MacExternalTerminalService, WindowsExternalTerminalService } from 'vs/platform/externalTerminal/node/externalTerminalService';
|
||||
|
||||
const mockConfig = Object.freeze<IExternalTerminalConfiguration>({
|
||||
terminal: {
|
||||
explorerKind: 'external',
|
||||
external: {
|
||||
windowsExec: 'testWindowsShell',
|
||||
osxExec: 'testOSXShell',
|
||||
linuxExec: 'testLinuxShell'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
suite('ExternalTerminalService', () => {
|
||||
let mockOnExit: Function;
|
||||
let mockOnError: Function;
|
||||
let mockConfig: any;
|
||||
|
||||
setup(() => {
|
||||
mockConfig = {
|
||||
terminal: {
|
||||
explorerKind: 'external',
|
||||
external: {
|
||||
windowsExec: 'testWindowsShell',
|
||||
osxExec: 'testOSXShell',
|
||||
linuxExec: 'testLinuxShell'
|
||||
}
|
||||
}
|
||||
};
|
||||
mockOnExit = (s: any) => s;
|
||||
mockOnError = (e: any) => e;
|
||||
});
|
||||
|
||||
test(`WinTerminalService - uses terminal from configuration`, done => {
|
||||
let testShell = 'cmd';
|
||||
let testCwd = 'path/to/workspace';
|
||||
let mockSpawner = {
|
||||
const testShell = 'cmd';
|
||||
const testCwd = 'path/to/workspace';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(command, testShell, 'shell should equal expected');
|
||||
equal(args[args.length - 1], mockConfig.terminal.external.windowsExec, 'terminal should equal expected');
|
||||
equal(opts.cwd, testCwd, 'opts.cwd should equal expected');
|
||||
strictEqual(command, testShell, 'shell should equal expected');
|
||||
strictEqual(args[args.length - 1], mockConfig.terminal.external.windowsExec);
|
||||
strictEqual(opts.cwd, testCwd);
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
};
|
||||
}
|
||||
};
|
||||
let testService = new WindowsExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new WindowsExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
mockConfig.terminal.external,
|
||||
testShell,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`WinTerminalService - uses default terminal when configuration.terminal.external.windowsExec is undefined`, done => {
|
||||
let testShell = 'cmd';
|
||||
let testCwd = 'path/to/workspace';
|
||||
let mockSpawner = {
|
||||
const testShell = 'cmd';
|
||||
const testCwd = 'path/to/workspace';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(args[args.length - 1], WindowsExternalTerminalService.getDefaultTerminalWindows(), 'terminal should equal expected');
|
||||
strictEqual(args[args.length - 1], WindowsExternalTerminalService.getDefaultTerminalWindows());
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
@@ -67,162 +55,139 @@ suite('ExternalTerminalService', () => {
|
||||
}
|
||||
};
|
||||
mockConfig.terminal.external.windowsExec = undefined;
|
||||
let testService = new WindowsExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new WindowsExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
mockConfig.terminal.external,
|
||||
testShell,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`WinTerminalService - uses default terminal when configuration.terminal.external.windowsExec is undefined`, done => {
|
||||
let testShell = 'cmd';
|
||||
let testCwd = 'c:/foo';
|
||||
let mockSpawner = {
|
||||
const testShell = 'cmd';
|
||||
const testCwd = 'c:/foo';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(opts.cwd, 'C:/foo', 'cwd should be uppercase regardless of the case that\'s passed in');
|
||||
strictEqual(opts.cwd, 'C:/foo', 'cwd should be uppercase regardless of the case that\'s passed in');
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
};
|
||||
}
|
||||
};
|
||||
let testService = new WindowsExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new WindowsExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
mockConfig.terminal.external,
|
||||
testShell,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`WinTerminalService - cmder should be spawned differently`, done => {
|
||||
let testShell = 'cmd';
|
||||
mockConfig.terminal.external.windowsExec = 'cmder';
|
||||
let testCwd = 'c:/foo';
|
||||
let mockSpawner = {
|
||||
const testShell = 'cmd';
|
||||
const testCwd = 'c:/foo';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
deepEqual(args, ['C:/foo']);
|
||||
equal(opts, undefined);
|
||||
deepStrictEqual(args, ['C:/foo']);
|
||||
strictEqual(opts, undefined);
|
||||
done();
|
||||
return { on: (evt: any) => evt };
|
||||
}
|
||||
};
|
||||
let testService = new WindowsExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new WindowsExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
{ windowsExec: 'cmder' },
|
||||
testShell,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`WinTerminalService - windows terminal should open workspace directory`, done => {
|
||||
let testShell = 'wt';
|
||||
let testCwd = 'c:/foo';
|
||||
let mockSpawner = {
|
||||
const testShell = 'wt';
|
||||
const testCwd = 'c:/foo';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(opts.cwd, 'C:/foo');
|
||||
strictEqual(opts.cwd, 'C:/foo');
|
||||
done();
|
||||
return { on: (evt: any) => evt };
|
||||
}
|
||||
};
|
||||
let testService = new WindowsExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new WindowsExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
mockConfig.terminal.external,
|
||||
testShell,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`MacTerminalService - uses terminal from configuration`, done => {
|
||||
let testCwd = 'path/to/workspace';
|
||||
let mockSpawner = {
|
||||
const testCwd = 'path/to/workspace';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(args[1], mockConfig.terminal.external.osxExec, 'terminal should equal expected');
|
||||
strictEqual(args[1], mockConfig.terminal.external.osxExec);
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
};
|
||||
}
|
||||
};
|
||||
let testService = new MacExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new MacExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
mockConfig.terminal.external,
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`MacTerminalService - uses default terminal when configuration.terminal.external.osxExec is undefined`, done => {
|
||||
let testCwd = 'path/to/workspace';
|
||||
let mockSpawner = {
|
||||
const testCwd = 'path/to/workspace';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(args[1], DEFAULT_TERMINAL_OSX, 'terminal should equal expected');
|
||||
strictEqual(args[1], DEFAULT_TERMINAL_OSX);
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
};
|
||||
}
|
||||
};
|
||||
mockConfig.terminal.external.osxExec = undefined;
|
||||
let testService = new MacExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new MacExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
{ osxExec: undefined },
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`LinuxTerminalService - uses terminal from configuration`, done => {
|
||||
let testCwd = 'path/to/workspace';
|
||||
let mockSpawner = {
|
||||
const testCwd = 'path/to/workspace';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(command, mockConfig.terminal.external.linuxExec, 'terminal should equal expected');
|
||||
equal(opts.cwd, testCwd, 'opts.cwd should equal expected');
|
||||
strictEqual(command, mockConfig.terminal.external.linuxExec);
|
||||
strictEqual(opts.cwd, testCwd);
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
};
|
||||
}
|
||||
};
|
||||
let testService = new LinuxExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new LinuxExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
mockConfig.terminal.external,
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
|
||||
test(`LinuxTerminalService - uses default terminal when configuration.terminal.external.linuxExec is undefined`, done => {
|
||||
LinuxExternalTerminalService.getDefaultTerminalLinuxReady().then(defaultTerminalLinux => {
|
||||
let testCwd = 'path/to/workspace';
|
||||
let mockSpawner = {
|
||||
const testCwd = 'path/to/workspace';
|
||||
const mockSpawner: any = {
|
||||
spawn: (command: any, args: any, opts: any) => {
|
||||
// assert
|
||||
equal(command, defaultTerminalLinux, 'terminal should equal expected');
|
||||
strictEqual(command, defaultTerminalLinux);
|
||||
done();
|
||||
return {
|
||||
on: (evt: any) => evt
|
||||
@@ -230,13 +195,11 @@ suite('ExternalTerminalService', () => {
|
||||
}
|
||||
};
|
||||
mockConfig.terminal.external.linuxExec = undefined;
|
||||
let testService = new LinuxExternalTerminalService();
|
||||
(<any>testService).spawnTerminal(
|
||||
const testService = new LinuxExternalTerminalService();
|
||||
testService.spawnTerminal(
|
||||
mockSpawner,
|
||||
mockConfig,
|
||||
testCwd,
|
||||
mockOnExit,
|
||||
mockOnError
|
||||
mockConfig.terminal.external,
|
||||
testCwd
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -320,7 +320,7 @@ function getSanitizedEnvironment(process: NodeJS.Process) {
|
||||
/**
|
||||
* tries to turn OS errors into more meaningful error messages
|
||||
*/
|
||||
function improveError(err: Error & { errno?: string, path?: string }): Error {
|
||||
function improveError(err: Error & { errno?: string; path?: string }): Error {
|
||||
if ('errno' in err && err['errno'] === 'ENOENT' && 'path' in err && typeof err['path'] === 'string') {
|
||||
return new Error(nls.localize('ext.term.app.not.found', "can't find terminal application '{0}'", err['path']));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user