mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-26 17:24:21 -05:00
fix schema comparing empty project showing more differences than expected (#1727)
This commit is contained in:
@@ -22,6 +22,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SchemaCompare
|
||||
{
|
||||
internal static class SchemaCompareTestUtils
|
||||
{
|
||||
private static string sqlProjectsFolder = Path.Combine("..", "..", "..", "SchemaCompare", "SqlProjects");
|
||||
|
||||
internal static void VerifyAndCleanup(string path)
|
||||
{
|
||||
// verify it was created...
|
||||
@@ -61,12 +63,17 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SchemaCompare
|
||||
return extractParams.PackageFilePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an SDK-style .sqlproj from the database
|
||||
/// </summary>
|
||||
/// <param name="testdb">Database to create the sql project from</param>
|
||||
/// <param name="projectName">Name of the project</param>
|
||||
/// <returns>Full path to the project folder</returns>
|
||||
internal static string CreateProject(SqlTestDb testdb, string projectName)
|
||||
{
|
||||
var result = GetLiveAutoCompleteTestObjects();
|
||||
string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "SchemaCompareTest", projectName);
|
||||
Directory.CreateDirectory(folderPath);
|
||||
File.Create(Path.Combine(folderPath, projectName + ".sqlproj")).Close();
|
||||
string sqlprojFilePath = CreateSqlProj(projectName);
|
||||
string folderPath = Path.GetDirectoryName(sqlprojFilePath);
|
||||
|
||||
var extractParams = new ExtractParams
|
||||
{
|
||||
@@ -84,6 +91,21 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SchemaCompare
|
||||
return folderPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an empty SDK-style .sqlproj
|
||||
/// </summary>
|
||||
/// <param name="projectName">name for the .sqlproj</param>
|
||||
/// <returns>Full path to the .sqlproj</returns>
|
||||
internal static string CreateSqlProj(string projectName)
|
||||
{
|
||||
string folderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "SchemaCompareTest", projectName);
|
||||
Directory.CreateDirectory(folderPath);
|
||||
string sqlprojFilePath = Path.Combine(folderPath, projectName + ".sqlproj");
|
||||
File.Copy(Path.Combine(sqlProjectsFolder, "emptyTemplate.sqlproj"), sqlprojFilePath);
|
||||
|
||||
return sqlprojFilePath;
|
||||
}
|
||||
|
||||
internal static string[] GetProjectScripts(string projectPath)
|
||||
{
|
||||
return Directory.GetFiles(projectPath, "*.sql", SearchOption.AllDirectories);
|
||||
|
||||
Reference in New Issue
Block a user