Fix/integrationtests (#391)

* fixed the problem with parsing sql2017 version
This commit is contained in:
Leila Lali
2017-06-22 09:20:58 -07:00
committed by GitHub
parent af2ed84953
commit c28a97e6fa
9 changed files with 83 additions and 37 deletions

View File

@@ -828,17 +828,29 @@ GO";
/// </summary>
private void Cleanup(Location[] locations)
{
Uri fileUri = new Uri(locations[0].Uri);
if (File.Exists(fileUri.LocalPath))
try
{
try
string filePath = locations[0].Uri;
Uri fileUri = null;
if (Uri.IsWellFormedUriString(filePath, UriKind.Absolute))
{
File.Delete(fileUri.LocalPath);
fileUri = new Uri(filePath);
}
catch (Exception)
else
{
filePath = filePath.Replace("file:/", "file://");
if (Uri.IsWellFormedUriString(filePath, UriKind.Absolute))
{
fileUri = new Uri(filePath);
}
}
if (fileUri != null && File.Exists(fileUri.LocalPath))
{
File.Delete(fileUri.LocalPath);
}
}
catch (Exception)
{
}
}

View File

@@ -375,7 +375,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
VerifyMetadata(child);
if (stringBuilder != null && child.NodeType != "Folder" && child.NodeType != "FileGroupFile")
{
stringBuilder.AppendLine($"NodeType: {child.NodeType} Label: {child.Label} SubType:{child.NodeSubType} Status:{child.NodeStatus}");
stringBuilder.Append($"NodeType: {child.NodeType} Label: {child.Label} SubType:{child.NodeSubType} Status:{child.NodeStatus}{Environment.NewLine}");
}
if (!verifySystemObjects && (child.Label == SR.SchemaHierarchy_SystemStoredProcedures ||
child.Label == SR.SchemaHierarchy_SystemViews ||

View File

@@ -54,8 +54,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common.Baselined
private string _baselineSubDir = string.Empty;
public const string TestScriptDirectory = @"Testscripts\";
public const string BaselineDirectory = @"Baselines\";
public const string TestScriptDirectory = @"Testscripts";
public const string BaselineDirectory = @"Baselines";
/// <summary>
/// Gets/Sets the extension for the Testscript files

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
WORKINGDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
dotnet restore $WORKINGDIR
dotnet restore $WORKINGDIR../../src/Microsoft.SqlTools.ServiceLayer/project.json
dotnet build $WORKINGDIR../../src/Microsoft.SqlTools.ServiceLayer\project.json
cd ..
dotnet restore
dotnet build Microsoft.SqlTools.ServiceLayer.TestDriver/project.json
dotnet build Microsoft.SqlTools.ServiceLayer.Test.Common/project.json
dotnet build Microsoft.SqlTools.ServiceLayer.TestEnvConfig/project.json
cd Microsoft.SqlTools.ServiceLayer.TestEnvConfig
dotnet run "$1"

View File

@@ -4,6 +4,7 @@
//
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.SqlTools.Extensibility;
using Microsoft.SqlTools.Hosting.Protocol;
@@ -56,6 +57,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.TaskServices
serviceHostMock.Verify(x => x.SendEvent(TaskCreatedNotification.Type,
It.Is<TaskInfo>(t => t.TaskId == sqlTask.TaskId.ToString() && t.ProviderName == "MSSQL")), Times.Once());
operation.Stop();
Thread.Sleep(2000);
serviceHostMock.Verify(x => x.SendEvent(TaskStatusChangedNotification.Type,
It.Is<TaskProgressInfo>(t => t.TaskId == sqlTask.TaskId.ToString())), Times.AtLeastOnce());