From b0f7ba4084213ed0e30458bc7e4fab1db2c4cfa4 Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Thu, 27 Oct 2016 05:00:14 +0000 Subject: [PATCH] Turn on disabled tests in integration suite (#120) No real code changes, just reenabling disabled tests in integration test runs. --- .../LanguageServer/LanguageServiceTests.cs | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/test/Microsoft.SqlTools.ServiceLayer.Test/LanguageServer/LanguageServiceTests.cs b/test/Microsoft.SqlTools.ServiceLayer.Test/LanguageServer/LanguageServiceTests.cs index 9ce596e5..e0f2c802 100644 --- a/test/Microsoft.SqlTools.ServiceLayer.Test/LanguageServer/LanguageServiceTests.cs +++ b/test/Microsoft.SqlTools.ServiceLayer.Test/LanguageServer/LanguageServiceTests.cs @@ -145,11 +145,13 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices #region "General Language Service tests" + +#if LIVE_CONNECTION_TESTS /// /// Test the service initialization code path and verify nothing throws /// // Test is causing failures in build lab..investigating to reenable - //[Fact] + [Fact] public void ServiceInitiailzation() { InitializeTestServices(); @@ -167,7 +169,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices /// Test the service initialization code path and verify nothing throws /// // Test is causing failures in build lab..investigating to reenable - //[Fact] + [Fact] public void PrepopulateCommonMetadata() { InitializeTestServices(); @@ -194,6 +196,31 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices AutoCompleteHelper.PrepopulateCommonMetadata(connInfo, scriptInfo, null); } + // This test currently requires a live database connection to initialize + // SMO connected metadata provider. Since we don't want a live DB dependency + // in the CI unit tests this scenario is currently disabled. + [Fact] + public void AutoCompleteFindCompletions() + { + TextDocumentPosition textDocument; + ConnectionInfo connInfo; + ScriptFile scriptFile; + Common.GetAutoCompleteTestObjects(out textDocument, out scriptFile, out connInfo); + + textDocument.Position.Character = 7; + scriptFile.Contents = "select "; + + var autoCompleteService = LanguageService.Instance; + var completions = autoCompleteService.GetCompletionItems( + textDocument, + scriptFile, + connInfo); + + Assert.True(completions.Length > 0); + } + +#endif + private string GetTestSqlFile() { string filePath = Path.Combine( @@ -255,29 +282,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices #region "Autocomplete Tests" - // This test currently requires a live database connection to initialize - // SMO connected metadata provider. Since we don't want a live DB dependency - // in the CI unit tests this scenario is currently disabled. - //[Fact] - public void AutoCompleteFindCompletions() - { - TextDocumentPosition textDocument; - ConnectionInfo connInfo; - ScriptFile scriptFile; - Common.GetAutoCompleteTestObjects(out textDocument, out scriptFile, out connInfo); - - textDocument.Position.Character = 7; - scriptFile.Contents = "select "; - - var autoCompleteService = LanguageService.Instance; - var completions = autoCompleteService.GetCompletionItems( - textDocument, - scriptFile, - connInfo); - - Assert.True(completions.Length > 0); - } - /// /// Creates a mock db command that returns a predefined result set ///