mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -30,10 +30,10 @@ import { MockQuickInputService } from 'sql/workbench/contrib/notebook/test/commo
|
||||
class TestClientSession extends ClientSessionStub {
|
||||
private _errorState: boolean = false;
|
||||
setErrorState = (value: boolean) => this._errorState = value;
|
||||
get isInErrorState(): boolean {
|
||||
override get isInErrorState(): boolean {
|
||||
return this._errorState;
|
||||
}
|
||||
get kernel(): azdata.nb.IKernel {
|
||||
override get kernel(): azdata.nb.IKernel {
|
||||
return <azdata.nb.IKernel>{
|
||||
name: 'StandardKernel1'
|
||||
};
|
||||
@@ -43,11 +43,11 @@ class TestNotebookModel extends NotebookModelStub {
|
||||
private _clientSession: TestClientSession = new TestClientSession();
|
||||
public kernelChangedEmitter: Emitter<azdata.nb.IKernelChangedArgs> = new Emitter<azdata.nb.IKernelChangedArgs>();
|
||||
|
||||
public get kernelChanged() {
|
||||
public override get kernelChanged() {
|
||||
return this.kernelChangedEmitter.event;
|
||||
}
|
||||
|
||||
public get clientSession(): TestClientSession {
|
||||
public override get clientSession(): TestClientSession {
|
||||
return this._clientSession;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class TestNotebookModel extends NotebookModelStub {
|
||||
return [...this._standardKernelsMap.values()].map(x => x.displayName);
|
||||
}
|
||||
|
||||
public get specs(): azdata.nb.IAllKernels | undefined {
|
||||
public override get specs(): azdata.nb.IAllKernels | undefined {
|
||||
return {
|
||||
defaultKernel: 'SpecKernel1',
|
||||
// The name and displayName are set to same value
|
||||
@@ -100,7 +100,7 @@ class TestNotebookModel extends NotebookModelStub {
|
||||
};
|
||||
}
|
||||
|
||||
public getStandardKernelFromName(name: string): IStandardKernelWithProvider {
|
||||
public override getStandardKernelFromName(name: string): IStandardKernelWithProvider {
|
||||
return this._standardKernelsMap.get(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,25 +64,25 @@ class NotebookModelStub extends stubs.NotebookModelStub {
|
||||
private _kernelChangedEmitter = new Emitter<nb.IKernelChangedArgs>();
|
||||
private _onActiveCellChanged = new Emitter<ICellModel>();
|
||||
|
||||
public get contentChanged(): Event<NotebookContentChange> {
|
||||
public override get contentChanged(): Event<NotebookContentChange> {
|
||||
return this.contentChangedEmitter.event;
|
||||
}
|
||||
|
||||
get kernelChanged(): Event<nb.IKernelChangedArgs> {
|
||||
override get kernelChanged(): Event<nb.IKernelChangedArgs> {
|
||||
return this._kernelChangedEmitter.event;
|
||||
}
|
||||
|
||||
get onActiveCellChanged(): Event<ICellModel> {
|
||||
override get onActiveCellChanged(): Event<ICellModel> {
|
||||
return this._onActiveCellChanged.event;
|
||||
}
|
||||
|
||||
updateActiveCell(cell: ICellModel) {
|
||||
override updateActiveCell(cell: ICellModel) {
|
||||
// do nothing.
|
||||
// When relevant a mock is used to intercept this call to do any verifications or run
|
||||
// any code relevant for testing in the context of the test.
|
||||
}
|
||||
|
||||
get activeCell(): ICellModel {
|
||||
override get activeCell(): ICellModel {
|
||||
return <ICellModel>{};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,21 +7,23 @@ import * as assert from 'assert';
|
||||
import * as Platform from 'vs/platform/registry/common/platform';
|
||||
import { ViewletDescriptor, Extensions, ViewletRegistry, Viewlet } from 'vs/workbench/browser/viewlet';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
import { workbenchInstantiationService } from 'sql/workbench/test/workbenchTestServices';
|
||||
import { Extensions as ViewContainerExtensions, IViewDescriptor, IViewsRegistry } from 'vs/workbench/common/views';
|
||||
import { NotebookExplorerViewPaneContainer, NOTEBOOK_VIEW_CONTAINER } from 'sql/workbench/contrib/notebook/browser/notebookExplorer/notebookExplorerViewlet';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
|
||||
suite('Notebook Explorer Views', () => {
|
||||
|
||||
class NotebookExplorerTestViewlet extends Viewlet {
|
||||
|
||||
constructor() {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
super('notebookExplorer', instantiationService.createInstance(NotebookExplorerViewPaneContainer), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
super('notebookExplorer', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||
}
|
||||
|
||||
public layout(dimension: any): void {
|
||||
public override layout(dimension: any): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected createViewPaneContainer(parent: HTMLElement): ViewPaneContainer {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
|
||||
@@ -62,13 +62,13 @@ suite('Notebook Input', function (): void {
|
||||
testTitle, fileUri, undefined,
|
||||
undefined, instantiationService, mockNotebookService.object, mockExtensionService.object);
|
||||
|
||||
let inputId = fileNotebookInput.getTypeId();
|
||||
let inputId = fileNotebookInput.typeId;
|
||||
assert.strictEqual(inputId, FileNotebookInput.ID);
|
||||
assert.strictEqual(fileNotebookInput.isUntitled(), false, 'File Input should not be untitled');
|
||||
});
|
||||
|
||||
test('Untitled Notebook Input', async function (): Promise<void> {
|
||||
let inputId = untitledNotebookInput.getTypeId();
|
||||
let inputId = untitledNotebookInput.typeId;
|
||||
assert.strictEqual(inputId, UntitledNotebookInput.ID);
|
||||
assert.ok(untitledNotebookInput.isUntitled(), 'Untitled Input should be untitled');
|
||||
});
|
||||
|
||||
@@ -55,12 +55,12 @@ suite('Local Content Manager', function (): void {
|
||||
setup(() => {
|
||||
const instantiationService = new TestInstantiationService();
|
||||
const fileService = new class extends TestFileService {
|
||||
async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise<IFileContent> {
|
||||
override async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise<IFileContent> {
|
||||
const content = await promisify(fs.readFile)(resource.fsPath);
|
||||
|
||||
return { name: ',', size: 0, etag: '', mtime: 0, value: VSBuffer.fromString(content.toString()), resource, ctime: 0 };
|
||||
}
|
||||
async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {
|
||||
override async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {
|
||||
await pfs.writeFile(resource.fsPath, bufferOrReadable.toString());
|
||||
return { resource: resource, mtime: 0, etag: '', size: 0, name: '', isDirectory: false, ctime: 0, isFile: true, isSymbolicLink: false };
|
||||
}
|
||||
|
||||
@@ -980,7 +980,7 @@ suite('Notebook Editor Model', function (): void {
|
||||
async function createTextEditorModel(self: Mocha.Context): Promise<NotebookEditorModel> {
|
||||
let textFileEditorModel = instantiationService.createInstance(TextFileEditorModel, toResource.call(self, defaultUri.toString()), 'utf8', undefined);
|
||||
(<TestTextFileEditorModelManager>accessor.textFileService.files).add(textFileEditorModel.resource, textFileEditorModel);
|
||||
await textFileEditorModel.load();
|
||||
await textFileEditorModel.resolve();
|
||||
return new NotebookEditorModel(defaultUri, textFileEditorModel, mockNotebookService.object, testResourcePropertiesService);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import { Event, Emitter } from 'vs/base/common/event';
|
||||
|
||||
export class NBTestQueryManagementService extends TestQueryManagementService {
|
||||
onHandlerAddedEmitter = new Emitter<string>();
|
||||
onHandlerAdded: Event<string> = this.onHandlerAddedEmitter.event;
|
||||
override onHandlerAdded: Event<string> = this.onHandlerAddedEmitter.event;
|
||||
|
||||
getRegisteredProviders(): string[] {
|
||||
override getRegisteredProviders(): string[] {
|
||||
return ['sql'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { QueryTextEditor } from 'sql/workbench/browser/modelComponents/queryTextEditor';
|
||||
import * as stubs from 'sql/workbench/contrib/notebook/test/stubs';
|
||||
import { INotebookModel, ICellModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { INotebookModel } from 'sql/workbench/services/notebook/browser/models/modelInterfaces';
|
||||
import { INotebookParams } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -17,17 +17,10 @@ import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServic
|
||||
// Typically you will pass in either editor or the instantiationService parameter.
|
||||
// Leave both undefined when you want the underlying object(s) to have an undefined editor.
|
||||
export class NotebookEditorStub extends stubs.NotebookEditorStub {
|
||||
cellEditors: CellEditorProviderStub[];
|
||||
model: INotebookModel | undefined;
|
||||
cells?: ICellModel[] = [];
|
||||
|
||||
public readonly id: string;
|
||||
|
||||
public readonly modelReady: Promise<INotebookModel>;
|
||||
|
||||
// Normally one needs to provide either the editor or the instantiationService as the constructor parameter
|
||||
constructor({ cellGuid, instantiationService, editor, model, notebookParams }: { cellGuid?: string; instantiationService?: IInstantiationService; editor?: QueryTextEditor; model?: INotebookModel, notebookParams?: INotebookParams } = {}) {
|
||||
super();
|
||||
this.cells = [];
|
||||
this.model = model;
|
||||
this.notebookParams = notebookParams;
|
||||
this.cellEditors = [new CellEditorProviderStub({ cellGuid: cellGuid, instantiationService: instantiationService, editor: editor })];
|
||||
@@ -63,10 +56,10 @@ class CellEditorProviderStub extends stubs.CellEditorProviderStub {
|
||||
}
|
||||
this._cellGuid = cellGuid;
|
||||
}
|
||||
cellGuid(): string {
|
||||
override cellGuid(): string {
|
||||
return this._cellGuid;
|
||||
}
|
||||
getEditor(): QueryTextEditor {
|
||||
override getEditor(): QueryTextEditor {
|
||||
return this._editor;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user