Filtering Schema Compare error from warnings (#1212)

* Filtering Schema Compare error from warnings

* SchemaCompare added comparison result error message validations to existing tests

* Extra semi-colon noticed and removed from the code

* Added new test case to validate warning message exclusions from SC result

* SC test asserions comment added

* Edge case scenario fixed and tests are 100% passed
This commit is contained in:
Sai Avishkar Sreerama
2021-05-21 11:25:25 +05:30
committed by GitHub
parent 64a6b6a85c
commit 37b2b26edf
3 changed files with 71 additions and 3 deletions

View File

@@ -120,9 +120,13 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
}
}
// Appending the set of errors that are stopping the schema compare to the ErrorMessage
var errorsList = ComparisonResult.GetErrors().Select(e => e.Message).Distinct().ToList();
ErrorMessage = string.Join("\n", errorsList);
// Appending the set of errors that are stopping the schema compare to the ErrorMessage
// GetErrors return all type of warnings, and error messages. Only filtering the error type messages here
var errorsList = ComparisonResult.GetErrors().Where(x => x.MessageType.Equals(Microsoft.SqlServer.Dac.DacMessageType.Error)).Select(e => e.Message).Distinct().ToList();
if (errorsList.Count > 0)
{
ErrorMessage = string.Join("\n", errorsList);
}
}
catch (Exception e)
{