mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
adding more logs for transient failure cases in schema compare (#15900)
This commit is contained in:
@@ -100,8 +100,8 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
let result1 = await dacfxService.deployDacpac(dacpac1, sourceDB, true, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
let result2 = await dacfxService.deployDacpac(dacpac2, targetDB, true, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
|
||||
assert(result1.success === true, 'Deploy source database should succeed');
|
||||
assert(result2.success === true, 'Deploy target database should succeed');
|
||||
assert(result1.success === true, `Deploy source database should succeed. Failed with error ${result1.errorMessage}`);
|
||||
assert(result2.success === true, `Deploy target database should succeed. Failed with error ${result2.errorMessage}`);
|
||||
await utils.assertDatabaseCreationResult(sourceDB, ownerUri, retryCount);
|
||||
await utils.assertDatabaseCreationResult(targetDB, ownerUri, retryCount);
|
||||
|
||||
@@ -170,7 +170,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
assert(dacfxService, 'DacFx Service Provider is not available');
|
||||
let result = await dacfxService.deployDacpac(dacpac2, targetDB, true, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
|
||||
assert(result.success === true, 'Deploy database 2 (target) should succeed');
|
||||
assert(result.success === true, `Deploy database 2 (target) should succeed. Failed with error : ${result.errorMessage}`);
|
||||
|
||||
let source: mssql.SchemaCompareEndpointInfo = {
|
||||
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
|
||||
@@ -288,7 +288,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
assert(dacfxService, 'DacFx Service Provider is not available');
|
||||
let result = await dacfxService.deployDacpac(dacpac1, targetDB, true, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
|
||||
assert(result.success === true, 'Deploy database 2 (target) should succeed');
|
||||
assert(result.success === true, `Deploy database 2 (target) should succeed. Failed with error : ${result.errorMessage}`);
|
||||
|
||||
const source: mssql.SchemaCompareEndpointInfo = {
|
||||
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
|
||||
@@ -324,7 +324,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
|
||||
//publish the updated changes. Function1 should not be added to the target database
|
||||
const publishChangesResult = await schemaCompareService.schemaComparePublishChanges(schemaCompareResult.operationId, server.serverName, targetDB, azdata.TaskExecutionMode.execute);
|
||||
assert(publishChangesResult.success === true, 'Publish changes should complete successfully. But it failed.');
|
||||
assert(publishChangesResult.success === true, `Publish changes should complete successfully. But it failed with error : ${publishChangesResult.errorMessage}`);
|
||||
|
||||
//verify table Table3 is added
|
||||
const dbConnectionId = await utils.connectToServer({
|
||||
@@ -363,7 +363,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
assert(dacfxService, 'DacFx Service Provider is not available');
|
||||
let result = await dacfxService.deployDacpac(dacpac1, targetDB, true, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
|
||||
assert(result.success === true, 'Deploy database 2 (target) should succeed');
|
||||
assert(result.success === true, `Deploy database 2 (target) should succeed. Failed with error : ${result.errorMessage}`);
|
||||
|
||||
const source: mssql.SchemaCompareEndpointInfo = {
|
||||
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
|
||||
@@ -391,7 +391,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
|
||||
//publish all the changes
|
||||
const publishChangesResult = await schemaCompareService.schemaComparePublishChanges(schemaCompareResult.operationId, server.serverName, targetDB, azdata.TaskExecutionMode.execute);
|
||||
assert(publishChangesResult.success === true, 'Publish changes should complete successfully. But it failed.');
|
||||
assert(publishChangesResult.success === true, `Publish changes should complete successfully. But it failed with error : ${publishChangesResult.errorMessage}`);
|
||||
|
||||
//verify table Table3 is added
|
||||
const dbConnectionId = await utils.connectToServer({
|
||||
@@ -426,7 +426,7 @@ suite('Schema compare integration test suite @DacFx@', () => {
|
||||
assert(dacfxService, 'DacFx Service Provider is not available');
|
||||
let result = await dacfxService.deployDacpac(dacpac1, targetDB, true, ownerUri, azdata.TaskExecutionMode.execute);
|
||||
|
||||
assert(result.success === true, 'Deploy database 2 (target) should succeed');
|
||||
assert(result.success === true, `Deploy database 2 (target) should succeed. Failed with error : ${result.errorMessage}`);
|
||||
|
||||
const source: mssql.SchemaCompareEndpointInfo = {
|
||||
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
|
||||
@@ -492,7 +492,7 @@ function assertIncludeExcludeResult(result: mssql.SchemaCompareIncludeExcludeRes
|
||||
|
||||
function assertSchemaCompareResult(schemaCompareResult: mssql.SchemaCompareResult, operationId: string, expectedDifferenceCount: number, expectedIfEqual: boolean = false): void {
|
||||
assert(schemaCompareResult.areEqual === expectedIfEqual, `Expected: the schemas equivalency to be ${expectedIfEqual} Actual: ${schemaCompareResult.areEqual}`);
|
||||
assert(schemaCompareResult.success === true, `Expected: success in schema compare. Actual: Failure`);
|
||||
assert(schemaCompareResult.success === true, `Expected: success in schema compare. Actual: Failure. failed with error : ${schemaCompareResult.errorMessage}`);
|
||||
assert(schemaCompareResult.errorMessage === null, `Expected: there should be no error for comparison. Actual Error message: "${schemaCompareResult.errorMessage}"`);
|
||||
assert(schemaCompareResult.differences.length === expectedDifferenceCount, `Expected: ${expectedDifferenceCount} differences. Actual differences: "${schemaCompareResult.differences.length}"`);
|
||||
assert(schemaCompareResult.operationId === operationId, `Operation Id Expected to be same as passed. Expected : ${operationId}, Actual ${schemaCompareResult.operationId}`);
|
||||
|
||||
Reference in New Issue
Block a user