|
|
|
|
@@ -30,7 +30,7 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
projFilePath = await testUtils.createTestSqlProjFile(baselines.openProjectFileBaseline);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
after(async function(): Promise<void> {
|
|
|
|
|
after(async function (): Promise<void> {
|
|
|
|
|
await testUtils.deleteGeneratedTestFolder();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -158,8 +158,8 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
|
|
|
|
|
let uri = project.getSystemDacpacUri(constants.masterDacpac);
|
|
|
|
|
let ssdtUri = project.getSystemDacpacSsdtUri(constants.masterDacpac);
|
|
|
|
|
should.equal(uri.fsPath, Uri.parse(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', '150', constants.masterDacpac)).fsPath);
|
|
|
|
|
should.equal(ssdtUri.fsPath, Uri.parse(path.join('$(DacPacRootPath)', 'Extensions', 'Microsoft', 'SQLDB', 'Extensions', 'SqlServer', '150', 'SqlSchemas', constants.masterDacpac)).fsPath);
|
|
|
|
|
should.equal(uri.fsPath, Uri.parse(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', '160', constants.masterDacpac)).fsPath);
|
|
|
|
|
should.equal(ssdtUri.fsPath, Uri.parse(path.join('$(DacPacRootPath)', 'Extensions', 'Microsoft', 'SQLDB', 'Extensions', 'SqlServer', '160', 'SqlSchemas', constants.masterDacpac)).fsPath);
|
|
|
|
|
|
|
|
|
|
await project.changeTargetPlatform(constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlServer2016)!);
|
|
|
|
|
uri = project.getSystemDacpacUri(constants.masterDacpac);
|
|
|
|
|
@@ -192,8 +192,8 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
let projFileText = await fs.readFile(projFilePath);
|
|
|
|
|
|
|
|
|
|
should.equal(project.databaseReferences.length, 1, 'System db reference should have been added');
|
|
|
|
|
should(projFileText.includes(convertSlashesForSqlProj(Uri.file(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', '150', constants.masterDacpac)).fsPath.substring(1)))).be.true('System db reference path should be 150');
|
|
|
|
|
should(projFileText.includes(convertSlashesForSqlProj(Uri.file(path.join('$(DacPacRootPath)', 'Extensions', 'Microsoft', 'SQLDB', 'Extensions', 'SqlServer', '150', 'SqlSchemas', constants.masterDacpac)).fsPath.substring(1)))).be.true('System db SSDT reference path should be 150');
|
|
|
|
|
should(projFileText.includes(convertSlashesForSqlProj(Uri.file(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', '160', constants.masterDacpac)).fsPath.substring(1)))).be.true('System db reference path should be 160');
|
|
|
|
|
should(projFileText.includes(convertSlashesForSqlProj(Uri.file(path.join('$(DacPacRootPath)', 'Extensions', 'Microsoft', 'SQLDB', 'Extensions', 'SqlServer', '160', 'SqlSchemas', constants.masterDacpac)).fsPath.substring(1)))).be.true('System db SSDT reference path should be 160');
|
|
|
|
|
|
|
|
|
|
await project.changeTargetPlatform(constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlServer2016)!);
|
|
|
|
|
projFileText = await fs.readFile(projFilePath);
|
|
|
|
|
@@ -217,8 +217,8 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
|
|
|
|
|
let uri = project.getSystemDacpacUri(constants.msdbDacpac);
|
|
|
|
|
let ssdtUri = project.getSystemDacpacSsdtUri(constants.msdbDacpac);
|
|
|
|
|
should.equal(uri.fsPath, Uri.parse(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', '150', constants.msdbDacpac)).fsPath);
|
|
|
|
|
should.equal(ssdtUri.fsPath, Uri.parse(path.join('$(DacPacRootPath)', 'Extensions', 'Microsoft', 'SQLDB', 'Extensions', 'SqlServer', '150', 'SqlSchemas', constants.msdbDacpac)).fsPath);
|
|
|
|
|
should.equal(uri.fsPath, Uri.parse(path.join('$(NETCoreTargetsPath)', 'SystemDacpacs', '160', constants.msdbDacpac)).fsPath);
|
|
|
|
|
should.equal(ssdtUri.fsPath, Uri.parse(path.join('$(DacPacRootPath)', 'Extensions', 'Microsoft', 'SQLDB', 'Extensions', 'SqlServer', '160', 'SqlSchemas', constants.msdbDacpac)).fsPath);
|
|
|
|
|
|
|
|
|
|
await project.changeTargetPlatform(constants.targetPlatformToVersion.get(SqlTargetPlatform.sqlServer2016)!);
|
|
|
|
|
uri = project.getSystemDacpacUri(constants.msdbDacpac);
|
|
|
|
|
@@ -335,7 +335,7 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
await project.addProjectReference({
|
|
|
|
|
projectName: 'project1',
|
|
|
|
|
projectGuid: '',
|
|
|
|
|
projectRelativePath: Uri.file(path.join('..','project1', 'project1.sqlproj')),
|
|
|
|
|
projectRelativePath: Uri.file(path.join('..', 'project1', 'project1.sqlproj')),
|
|
|
|
|
suppressMissingDependenciesErrors: false
|
|
|
|
|
});
|
|
|
|
|
should(project.databaseReferences.length).equal(1, 'There should be a database reference after adding a reference to project1');
|
|
|
|
|
@@ -358,7 +358,7 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
await project.addProjectReference({
|
|
|
|
|
projectName: 'project1',
|
|
|
|
|
projectGuid: '',
|
|
|
|
|
projectRelativePath: Uri.file(path.join('..','project1', 'project1.sqlproj')),
|
|
|
|
|
projectRelativePath: Uri.file(path.join('..', 'project1', 'project1.sqlproj')),
|
|
|
|
|
databaseName: 'testdbName',
|
|
|
|
|
databaseVariable: 'testdb',
|
|
|
|
|
suppressMissingDependenciesErrors: false
|
|
|
|
|
@@ -386,7 +386,7 @@ describe('Project: sqlproj content operations', function (): void {
|
|
|
|
|
await project.addProjectReference({
|
|
|
|
|
projectName: 'project1',
|
|
|
|
|
projectGuid: '',
|
|
|
|
|
projectRelativePath: Uri.file(path.join('..','project1', 'project1.sqlproj')),
|
|
|
|
|
projectRelativePath: Uri.file(path.join('..', 'project1', 'project1.sqlproj')),
|
|
|
|
|
databaseName: 'testdbName',
|
|
|
|
|
databaseVariable: 'testdb',
|
|
|
|
|
serverName: 'otherServerName',
|
|
|
|
|
@@ -918,7 +918,7 @@ describe('Project: sdk style project content operations', function (): void {
|
|
|
|
|
sinon.restore();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
after(async function(): Promise<void> {
|
|
|
|
|
after(async function (): Promise<void> {
|
|
|
|
|
await testUtils.deleteGeneratedTestFolder();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1568,7 +1568,7 @@ describe('Project: add SQLCMD Variables', function (): void {
|
|
|
|
|
await baselines.loadBaselines();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
after(async function(): Promise<void> {
|
|
|
|
|
after(async function (): Promise<void> {
|
|
|
|
|
await testUtils.deleteGeneratedTestFolder();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1597,7 +1597,7 @@ describe('Project: properties', function (): void {
|
|
|
|
|
await baselines.loadBaselines();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
after(async function(): Promise<void> {
|
|
|
|
|
after(async function (): Promise<void> {
|
|
|
|
|
await testUtils.deleteGeneratedTestFolder();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1766,7 +1766,7 @@ describe('Project: round trip updates', function (): void {
|
|
|
|
|
sinon.restore();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
after(async function(): Promise<void> {
|
|
|
|
|
after(async function (): Promise<void> {
|
|
|
|
|
await testUtils.deleteGeneratedTestFolder();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -1857,7 +1857,7 @@ describe('Project: legacy to SDK-style updates', function (): void {
|
|
|
|
|
sinon.restore();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
after(async function(): Promise<void> {
|
|
|
|
|
after(async function (): Promise<void> {
|
|
|
|
|
await testUtils.deleteGeneratedTestFolder();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|