Task/script refactor (#476)

* scripting working with race conditions

* new service works with no race conditions

* use new scripting service and commented out tests

* refactored peek definition to use mssql-scripter

* fixed peek definition tests

* removed auto gen comment

* fixed peek definition highlighting bug

* made scripting async and fixed event handlers

* fixed tests (without cancel and plan notifs)

* removed dead code

* added nuget package

* CR comments + select script service implementation

* minor fixes and added test

* CR comments and script select

* added unit tests

* code review comments and cleanup

* fixed failing scripting tests
This commit is contained in:
Aditya Bist
2017-10-03 14:41:18 -07:00
committed by GitHub
parent 9091df8f62
commit 05702182ab
3 changed files with 14 additions and 11 deletions

View File

@@ -217,7 +217,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
}
[Fact]
public async Task ScriptSchemaCancel()
public async void ScriptSchemaCancel()
{
using (TestServiceDriverProvider testService = new TestServiceDriverProvider())
{
@@ -228,11 +228,12 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
ScriptOptions = new ScriptOptions
{
TypeOfDataToScript = "SchemaAndData",
},
}
};
ScriptingResult result = await testService.Script(requestParams);
ScriptingCancelResult cancelResult = await testService.CancelScript(result.OperationId);
var result = Task.Run(() => testService.Script(requestParams));
ScriptingProgressNotificationParams progressParams = await testService.Driver.WaitForEvent(ScriptingProgressNotificationEvent.Type, TimeSpan.FromSeconds(10));
Task.Run(() => testService.CancelScript(progressParams.OperationId));
ScriptingCompleteParams cancelEvent = await testService.Driver.WaitForEvent(ScriptingCompleteEvent.Type, TimeSpan.FromSeconds(10));
Assert.True(cancelEvent.Canceled);
}