add a project guid if a sql project doesn't have one (#18009)

This commit is contained in:
Kim Santiago
2022-01-07 16:01:39 -08:00
committed by GitHub
parent d13dd4d228
commit cd6b39ffee
5 changed files with 52 additions and 3 deletions

View File

@@ -1097,7 +1097,6 @@ describe('Project: sdk style project content operations', function (): void {
should(projFileText.includes('<Build Remove="folder1\\nestedFolder\\**" />')).equal(false, projFileText);
});
it('Should handle excluding nested glob included folders', async function (): Promise<void> {
const testFolderPath = await testUtils.generateTestFolderPath();
projFilePath = await testUtils.createTestSqlProjFile(baselines.openSdkStyleSqlProjectBaseline, testFolderPath);
@@ -1344,6 +1343,21 @@ describe('Project: sdk style project content operations', function (): void {
should(projFileText.includes('<Build Remove="folder1\\**" />')).equal(false, projFileText);
should(projFileText.includes('<Build Remove="folder2\\**" />')).equal(false, projFileText);
});
it('Should add a project guid if there is not one in the sqlproj', async function (): Promise<void> {
projFilePath = await testUtils.createTestSqlProjFile(baselines.openSdkStyleSqlProjectNoProjectGuidBaseline);
let projFileText = (await fs.readFile(projFilePath)).toString();
// verify no project guid
should(projFileText.includes(constants.ProjectGuid)).equal(false);
const project: Project = await Project.openProject(projFilePath);
// verify project guid was added
projFileText = (await fs.readFile(projFilePath)).toString();
should(project.projectGuid).not.equal(undefined);
should(projFileText.includes(constants.ProjectGuid)).equal(true);
});
});
describe('Project: add SQLCMD Variables', function (): void {