Include Object Types logic refactored and options fetching from DacFx (#20031)

* Include Object Types logic refactored and options fetching from DacFx

* Removed localized object types constants

* Prop name updated and references and tests updated

* updated comments

* STS vBump

* updating the test file to pass the PR Validations
This commit is contained in:
Sai Avishkar Sreerama
2022-08-08 12:12:59 -05:00
committed by GitHub
parent 2b5d2f0a0b
commit 54d4098f85
8 changed files with 88 additions and 823 deletions

View File

@@ -302,7 +302,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
assert(includeResult.affectedDependencies[0].included === true, 'Table t2 should be included as a result of including v1. Actual: false');
// excluding views from the comparison should make it so t2 can be excluded
deploymentOptions.excludeObjectTypes.value.push(mssql.SchemaObjectType.Views);
deploymentOptions.excludeObjectTypes.value.push(Object.keys(deploymentOptions.objectTypesDictionary).find((key) => { return deploymentOptions.objectTypesDictionary[key] === 'Views'; }));
await schemaCompareService.schemaCompare(operationId, source, target, azdata.TaskExecutionMode.execute, deploymentOptions);
const excludeResult3 = await schemaCompareService.schemaCompareIncludeExcludeNode(operationId, t2Difference, false, azdata.TaskExecutionMode.execute);
assertIncludeExcludeResult(excludeResult3, true, 0, 0);
@@ -507,7 +507,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
const deploymentOptionsResult = await schemaCompareService.schemaCompareGetDefaultOptions();
let deploymentOptions = deploymentOptionsResult.defaultDeploymentOptions;
deploymentOptions.excludeObjectTypes.value.push(mssql.SchemaObjectType.TableValuedFunctions);
deploymentOptions.excludeObjectTypes.value.push(Object.keys(deploymentOptions.objectTypesDictionary).find((key) => { return deploymentOptions.objectTypesDictionary[key] === 'TableValuedFunctions'; }));
const schemaCompareResult = await schemaCompareService.schemaCompare(operationId, source, target, azdata.TaskExecutionMode.execute, deploymentOptions);
assertSchemaCompareResult(schemaCompareResult, operationId, 3);