Don't show update project warning for new style sqlproj (#17490)

* don't show SSDT update warning for new style projects

* update strings

* add checks for the 2 other ways to specify msbuild sdk

* add link to docs on how to use project sdk

Co-authored-by: Kim Santiago <kisantia@Kims-MacBook-Pro.local>
This commit is contained in:
Kim Santiago
2021-10-27 12:53:38 -07:00
committed by GitHub
parent ab6b290b04
commit fee9c6e071
8 changed files with 112 additions and 22 deletions

View File

@@ -906,6 +906,10 @@ describe('Project: round trip updates', function (): void {
await baselines.loadBaselines();
});
beforeEach(function (): void {
sinon.restore();
});
it('Should update SSDT project to work in ADS', async function (): Promise<void> {
await testUpdateInRoundTrip(baselines.SSDTProjectFileBaseline, baselines.SSDTProjectAfterUpdateBaseline);
});
@@ -943,6 +947,29 @@ describe('Project: round trip updates', function (): void {
should(project.importedTargets.length).equal(3); // additional target should exist by default
});
it('Should not show update project warning message when opening msbuild sdk style project using Sdk node', async function (): Promise<void> {
await shouldNotShowUpdateWarning(baselines.newStyleProjectSdkNodeBaseline);
});
it('Should not show update project warning message when opening msbuild sdk style project using Project node with Sdk attribute', async function (): Promise<void> {
await shouldNotShowUpdateWarning(baselines.newStyleProjectSdkProjectAttributeBaseline);
});
it('Should not show update project warning message when opening msbuild sdk style project using Import node with Sdk attribute', async function (): Promise<void> {
await shouldNotShowUpdateWarning(baselines.newStyleProjectSdkImportAttributeBaseline);
});
async function shouldNotShowUpdateWarning(baselineFile: string): Promise<void> {
// setup test files
const folderPath = await testUtils.generateTestFolderPath();
const sqlProjPath = await testUtils.createTestSqlProjFile(baselineFile, folderPath);
const spy = sinon.spy(window, 'showWarningMessage');
const project = await Project.openProject(Uri.file(sqlProjPath).fsPath);
should(spy.notCalled).be.true();
should(project.isMsbuildSdkStyleProject).be.true();
}
});
async function testUpdateInRoundTrip(fileBeforeupdate: string, fileAfterUpdate: string): Promise<void> {
@@ -960,5 +987,3 @@ async function testUpdateInRoundTrip(fileBeforeupdate: string, fileAfterUpdate:
should(stub.calledOnce).be.true('showWarningMessage should have been called exactly once');
sinon.restore();
}