Initial project references changes (#11648)

* first changes for showing project references

* add tests

* fix interface and formatting

* add try so that project still gets loaded even if dependency project loading fails

* use instanceof

* add circular reference error
This commit is contained in:
Kim Santiago
2020-08-13 16:08:32 -07:00
committed by GitHub
parent d68433ec22
commit f3a48da3fa
9 changed files with 217 additions and 23 deletions

View File

@@ -87,6 +87,21 @@ describe('ProjectsController', function (): void {
should(project.dataSources.length).equal(2); // detailed datasources tests in their own test file
});
it('Should load both project and referenced project', async function (): Promise<void> {
// setup test projects
const folderPath = await testUtils.generateTestFolderPath();
await fs.mkdir(path.join(folderPath, 'proj1'));
await fs.mkdir(path.join(folderPath, 'ReferencedProject'));
const sqlProjPath = await testUtils.createTestSqlProjFile(baselines.openProjectWithProjectReferencesBaseline, path.join(folderPath, 'proj1'));
await testUtils.createTestSqlProjFile(baselines.openProjectFileBaseline, path.join(folderPath, 'ReferencedProject'));
const projController = new ProjectsController(new SqlDatabaseProjectTreeViewProvider());
await projController.openProject(vscode.Uri.file(sqlProjPath));
should(projController.projects.length).equal(2, 'Referenced project should have been opened when the project referencing it was opened');
});
it('Should not keep failed to load project in project list.', async function (): Promise<void> {
const folderPath = await testUtils.generateTestFolderPath();
const sqlProjPath = await testUtils.createTestSqlProjFile('empty file with no valid xml', folderPath);