mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 (#14050)
* Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 * Fix breaks * Extension management fixes * Fix breaks in windows bundling * Fix/skip failing tests * Update distro * Add clear to nuget.config * Add hygiene task * Bump distro * Fix hygiene issue * Add build to hygiene exclusion * Update distro * Update hygiene * Hygiene exclusions * Update tsconfig * Bump distro for server breaks * Update build config * Update darwin path * Add done calls to notebook tests * Skip failing tests * Disable smoke tests
This commit is contained in:
@@ -3,18 +3,17 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { workbenchInstantiationService as browserWorkbenchInstantiationService, ITestInstantiationService, TestLifecycleService, TestFilesConfigurationService, TestFileService, TestFileDialogService, TestPathService, TestEncodingOracle } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { workbenchInstantiationService as browserWorkbenchInstantiationService, ITestInstantiationService, TestLifecycleService, TestFilesConfigurationService, TestFileService, TestFileDialogService, TestPathService, TestEncodingOracle, TestProductService } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { ISharedProcessService } from 'vs/platform/ipc/electron-browser/sharedProcessService';
|
||||
import { NativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService';
|
||||
import { NativeTextFileService, } from 'vs/workbench/services/textfile/electron-browser/nativeTextFileService';
|
||||
import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { FileOperationError, IFileService } from 'vs/platform/files/common/files';
|
||||
import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService';
|
||||
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { INativeWorkbenchConfiguration, INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
|
||||
import { IDialogService, IFileDialogService, INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
@@ -40,8 +39,8 @@ import { TestContextService } from 'vs/workbench/test/common/workbenchTestServic
|
||||
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
|
||||
import { MouseInputEvent } from 'vs/base/parts/sandbox/common/electronTypes';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IOSProperties } from 'vs/platform/electron/common/electron';
|
||||
import { ColorScheme } from 'vs/platform/theme/common/theme';
|
||||
import { IOSProperties, IOSStatistics } from 'vs/platform/native/common/native';
|
||||
import { homedir, release } from 'os';
|
||||
|
||||
export const TestWorkbenchConfiguration: INativeWorkbenchConfiguration = {
|
||||
windowId: 0,
|
||||
@@ -54,11 +53,12 @@ export const TestWorkbenchConfiguration: INativeWorkbenchConfiguration = {
|
||||
userEnv: {},
|
||||
execPath: process.execPath,
|
||||
perfEntries: [],
|
||||
colorScheme: ColorScheme.DARK,
|
||||
colorScheme: { dark: true, highContrast: false },
|
||||
os: { release: release() },
|
||||
...parseArgs(process.argv, OPTIONS)
|
||||
};
|
||||
|
||||
export const TestEnvironmentService = new NativeWorkbenchEnvironmentService(TestWorkbenchConfiguration);
|
||||
export const TestEnvironmentService = new NativeWorkbenchEnvironmentService(TestWorkbenchConfiguration, TestProductService);
|
||||
|
||||
export class TestTextFileService extends NativeTextFileService {
|
||||
private resolveTextContentError!: FileOperationError | null;
|
||||
@@ -69,7 +69,7 @@ export class TestTextFileService extends NativeTextFileService {
|
||||
@ILifecycleService lifecycleService: ILifecycleService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IModelService modelService: IModelService,
|
||||
@IWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService,
|
||||
@INativeWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService,
|
||||
@IDialogService dialogService: IDialogService,
|
||||
@IFileDialogService fileDialogService: IFileDialogService,
|
||||
@ITextResourceConfigurationService textResourceConfigurationService: ITextResourceConfigurationService,
|
||||
@@ -77,11 +77,12 @@ export class TestTextFileService extends NativeTextFileService {
|
||||
@IFilesConfigurationService filesConfigurationService: IFilesConfigurationService,
|
||||
@ITextModelService textModelService: ITextModelService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@IPathService athService: IPathService,
|
||||
@IPathService pathService: IPathService,
|
||||
@IWorkingCopyFileService workingCopyFileService: IWorkingCopyFileService,
|
||||
@ILogService logService: ILogService,
|
||||
@IUriIdentityService uriIdentityService: IUriIdentityService,
|
||||
@IModeService modeService: IModeService
|
||||
@IModeService modeService: IModeService,
|
||||
@INativeHostService nativeHostService: INativeHostService
|
||||
) {
|
||||
super(
|
||||
fileService,
|
||||
@@ -93,15 +94,15 @@ export class TestTextFileService extends NativeTextFileService {
|
||||
dialogService,
|
||||
fileDialogService,
|
||||
textResourceConfigurationService,
|
||||
productService,
|
||||
filesConfigurationService,
|
||||
textModelService,
|
||||
codeEditorService,
|
||||
athService,
|
||||
pathService,
|
||||
workingCopyFileService,
|
||||
logService,
|
||||
uriIdentityService,
|
||||
modeService
|
||||
modeService,
|
||||
nativeHostService,
|
||||
logService
|
||||
);
|
||||
}
|
||||
|
||||
@@ -155,19 +156,20 @@ export class TestSharedProcessService implements ISharedProcessService {
|
||||
async whenSharedProcessReady(): Promise<void> { }
|
||||
}
|
||||
|
||||
export class TestElectronService implements IElectronService {
|
||||
export class TestNativeHostService implements INativeHostService {
|
||||
|
||||
declare readonly _serviceBrand: undefined;
|
||||
|
||||
readonly windowId = -1;
|
||||
|
||||
onWindowOpen: Event<number> = Event.None;
|
||||
onWindowMaximize: Event<number> = Event.None;
|
||||
onWindowUnmaximize: Event<number> = Event.None;
|
||||
onWindowFocus: Event<number> = Event.None;
|
||||
onWindowBlur: Event<number> = Event.None;
|
||||
onOSResume: Event<unknown> = Event.None;
|
||||
onColorSchemeChange = Event.None;
|
||||
onDidOpenWindow: Event<number> = Event.None;
|
||||
onDidMaximizeWindow: Event<number> = Event.None;
|
||||
onDidUnmaximizeWindow: Event<number> = Event.None;
|
||||
onDidFocusWindow: Event<number> = Event.None;
|
||||
onDidBlurWindow: Event<number> = Event.None;
|
||||
onDidResumeOS: Event<unknown> = Event.None;
|
||||
onDidChangeColorScheme = Event.None;
|
||||
onDidChangePassword = Event.None;
|
||||
|
||||
windowCount = Promise.resolve(1);
|
||||
getWindowCount(): Promise<number> { return this.windowCount; }
|
||||
@@ -187,6 +189,7 @@ export class TestElectronService implements IElectronService {
|
||||
async maximizeWindow(): Promise<void> { }
|
||||
async unmaximizeWindow(): Promise<void> { }
|
||||
async minimizeWindow(): Promise<void> { }
|
||||
async setMinimumSize(width: number | undefined, height: number | undefined): Promise<void> { }
|
||||
async focusWindow(options?: { windowId?: number | undefined; } | undefined): Promise<void> { }
|
||||
async showMessageBox(options: Electron.MessageBoxOptions): Promise<Electron.MessageBoxReturnValue> { throw new Error('Method not implemented.'); }
|
||||
async showSaveDialog(options: Electron.SaveDialogOptions): Promise<Electron.SaveDialogReturnValue> { throw new Error('Method not implemented.'); }
|
||||
@@ -198,8 +201,10 @@ export class TestElectronService implements IElectronService {
|
||||
async showItemInFolder(path: string): Promise<void> { }
|
||||
async setRepresentedFilename(path: string): Promise<void> { }
|
||||
async isAdmin(): Promise<boolean> { return false; }
|
||||
async getTotalMem(): Promise<number> { return 0; }
|
||||
async getOS(): Promise<IOSProperties> { return Object.create(null); }
|
||||
async writeElevated(source: URI, target: URI, options?: { overwriteReadonly?: boolean | undefined; }): Promise<void> { }
|
||||
async getOSProperties(): Promise<IOSProperties> { return Object.create(null); }
|
||||
async getOSStatistics(): Promise<IOSStatistics> { return Object.create(null); }
|
||||
async getOSVirtualMachineHint(): Promise<number> { return 0; }
|
||||
async killProcess(): Promise<void> { }
|
||||
async setDocumentEdited(edited: boolean): Promise<void> { }
|
||||
async openExternal(url: string): Promise<boolean> { return false; }
|
||||
@@ -230,6 +235,12 @@ export class TestElectronService implements IElectronService {
|
||||
async readClipboardBuffer(format: string): Promise<Uint8Array> { return Uint8Array.from([]); }
|
||||
async hasClipboard(format: string, type?: 'selection' | 'clipboard' | undefined): Promise<boolean> { return false; }
|
||||
async sendInputEvent(event: MouseInputEvent): Promise<void> { }
|
||||
async windowsGetStringRegKey(hive: 'HKEY_CURRENT_USER' | 'HKEY_LOCAL_MACHINE' | 'HKEY_CLASSES_ROOT' | 'HKEY_USERS' | 'HKEY_CURRENT_CONFIG', path: string, name: string): Promise<string | undefined> { return undefined; }
|
||||
async getPassword(service: string, account: string): Promise<string | null> { return null; }
|
||||
async setPassword(service: string, account: string, password: string): Promise<void> { }
|
||||
async deletePassword(service: string, account: string): Promise<boolean> { return false; }
|
||||
async findPassword(service: string): Promise<string | null> { return null; }
|
||||
async findCredentials(service: string): Promise<{ account: string; password: string; }[]> { return []; }
|
||||
}
|
||||
|
||||
export function workbenchInstantiationService(): ITestInstantiationService {
|
||||
@@ -238,7 +249,8 @@ export function workbenchInstantiationService(): ITestInstantiationService {
|
||||
pathService: insta => <IPathService>insta.createInstance(TestNativePathService)
|
||||
});
|
||||
|
||||
instantiationService.stub(IElectronService, new TestElectronService());
|
||||
instantiationService.stub(INativeHostService, new TestNativeHostService());
|
||||
instantiationService.stub(INativeWorkbenchEnvironmentService, TestEnvironmentService);
|
||||
|
||||
return instantiationService;
|
||||
}
|
||||
@@ -251,7 +263,7 @@ export class TestServiceAccessor {
|
||||
@IWorkspaceContextService public contextService: TestContextService,
|
||||
@IModelService public modelService: ModelServiceImpl,
|
||||
@IFileService public fileService: TestFileService,
|
||||
@IElectronService public electronService: TestElectronService,
|
||||
@INativeHostService public nativeHostService: TestNativeHostService,
|
||||
@IFileDialogService public fileDialogService: TestFileDialogService,
|
||||
@IBackupFileService public backupFileService: NodeTestBackupFileService,
|
||||
@IWorkingCopyService public workingCopyService: IWorkingCopyService,
|
||||
@@ -264,7 +276,7 @@ export class TestNativePathService extends TestPathService {
|
||||
|
||||
declare readonly _serviceBrand: undefined;
|
||||
|
||||
constructor(@IWorkbenchEnvironmentService environmentService: INativeWorkbenchEnvironmentService) {
|
||||
super(environmentService.userHome);
|
||||
constructor() {
|
||||
super(URI.file(homedir()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user