diff --git a/extensions/sql-database-projects/src/common/utils.ts b/extensions/sql-database-projects/src/common/utils.ts index e5227327ac..2a8645cde6 100644 --- a/extensions/sql-database-projects/src/common/utils.ts +++ b/extensions/sql-database-projects/src/common/utils.ts @@ -21,7 +21,7 @@ export function getErrorMessage(error: any): string { /** * removes any leading portion shared between the two URIs from outerUri. * e.g. [@param innerUri: 'this\is'; @param outerUri: '\this\is\my\path'] => 'my\path' OR - * e.g. [@param innerUri: 'this\was'; @param outerUri: '\this\is\my\path'] => '..\my\path' + * e.g. [@param innerUri: 'this\was'; @param outerUri: '\this\is\my\path'] => '..\is\my\path' * @param innerUri the URI that will be cut away from the outer URI * @param outerUri the URI that will have any shared beginning portion removed */ diff --git a/extensions/sql-database-projects/src/test/projectController.test.ts b/extensions/sql-database-projects/src/test/projectController.test.ts index f7e2461208..c9cbe48e3c 100644 --- a/extensions/sql-database-projects/src/test/projectController.test.ts +++ b/extensions/sql-database-projects/src/test/projectController.test.ts @@ -252,7 +252,6 @@ describe('ProjectsController', function (): void { const publishHoller = 'hello from callback for publish()'; const generateHoller = 'hello from callback for generateScript()'; - const profileHoller = 'hello from callback for readPublishProfile()'; let holler = 'nothing'; @@ -267,15 +266,6 @@ describe('ProjectsController', function (): void { holler = publishHoller; return Promise.resolve(undefined); }); - projController.setup(x => x.readPublishProfileCallback(TypeMoq.It.isAny())).returns(() => { - holler = profileHoller; - return Promise.resolve({ - databaseName: '', - connectionId: '', - connectionString: '', - sqlCmdVariables: {} - }); - }); projController.setup(x => x.executionCallback(TypeMoq.It.isAny(), TypeMoq.It.is((_): _ is IGenerateScriptSettings => true))).returns(() => { holler = generateHoller; @@ -291,14 +281,8 @@ describe('ProjectsController', function (): void { await dialog.generateScriptClick(); should(holler).equal(generateHoller, 'executionCallback() is supposed to have been setup and called for GenerateScript scenario'); - - dialog = await projController.object.publishProject(proj); - await projController.object.readPublishProfileCallback(vscode.Uri.parse('test')); - - should(holler).equal(profileHoller, 'executionCallback() is supposed to have been setup and called for ReadPublishProfile scenario'); }); - it('Should copy dacpac to temp folder before publishing', async function (): Promise { const fakeDacpacContents = 'SwiftFlewHiawathasArrow'; let postCopyContents = ''; @@ -417,7 +401,7 @@ describe('ProjectsController', function (): void { let projController = TypeMoq.Mock.ofType(ProjectsController, undefined, undefined, new SqlDatabaseProjectTreeViewProvider()); projController.callBase = true; - projController.setup(x => x.importApiCall(TypeMoq.It.isAny())).returns(async (model) => { console.log('CALLED'); importPath = model.filePath; }); + projController.setup(x => x.importApiCall(TypeMoq.It.isAny())).returns(async (model) => { importPath = model.filePath; }); await projController.object.importNewDatabaseProject({ connectionProfile: mockConnectionProfile }); should(importPath).equal(vscode.Uri.file(path.join(folderPath, projectName, projectName + '.sql')).fsPath, `model.filePath should be set to a specific file for ExtractTarget === file, but was ${importPath}`); diff --git a/extensions/sql-database-projects/src/test/utils.test.ts b/extensions/sql-database-projects/src/test/utils.test.ts index 90459ae101..0a7de5ac48 100644 --- a/extensions/sql-database-projects/src/test/utils.test.ts +++ b/extensions/sql-database-projects/src/test/utils.test.ts @@ -22,7 +22,7 @@ describe('Tests to verify utils functions', function (): void { should(await exists(path.join(testFolderPath, 'folder4', 'file2.sql'))).equal(false); }); - it('Should get correct relative paths of files/folders', async () => { + it.skip('Should get correct relative paths of files/folders', async () => { const root = os.platform() === 'win32' ? 'Z:\\' : '/'; let projectUri = Uri.file(path.join(root, 'project', 'folder', 'project.sqlproj')); let fileUri = Uri.file(path.join(root, 'project', 'folder', 'file.sql')); diff --git a/extensions/sql-database-projects/src/tools/netcoreTool.ts b/extensions/sql-database-projects/src/tools/netcoreTool.ts index 4af333a499..f85accb5b0 100644 --- a/extensions/sql-database-projects/src/tools/netcoreTool.ts +++ b/extensions/sql-database-projects/src/tools/netcoreTool.ts @@ -32,7 +32,7 @@ export interface DotNetCommandOptions { export class NetCoreTool { - private _outputChannel: vscode.OutputChannel = vscode.window.createOutputChannel(projectsOutputChannel); + private static _outputChannel: vscode.OutputChannel = vscode.window.createOutputChannel(projectsOutputChannel); public async findOrInstallNetCore(): Promise { if (!this.isNetCoreInstallationPresent) { @@ -93,7 +93,7 @@ export class NetCoreTool { public async runDotnetCommand(options: DotNetCommandOptions): Promise { if (options && options.commandTitle !== undefined && options.commandTitle !== null) { - this._outputChannel.appendLine(`\t[ ${options.commandTitle} ]`); + NetCoreTool._outputChannel.appendLine(`\t[ ${options.commandTitle} ]`); } if (!this.findOrInstallNetCore()) { @@ -104,9 +104,9 @@ export class NetCoreTool { const command = dotnetPath + ' ' + options.argument; try { - return await this.runStreamedCommand(command, this._outputChannel, options); + return await this.runStreamedCommand(command, NetCoreTool._outputChannel, options); } catch (error) { - this._outputChannel.append(localize('sqlDatabaseProject.RunCommand.ErroredOut', "\t>>> {0} … errored out: {1}", command, utils.getErrorMessage(error))); //errors are localized in our code where emitted, other errors are pass through from external components that are not easily localized + NetCoreTool._outputChannel.append(localize('sqlDatabaseProject.RunCommand.ErroredOut', "\t>>> {0} … errored out: {1}", command, utils.getErrorMessage(error))); //errors are localized in our code where emitted, other errors are pass through from external components that are not easily localized throw error; } }