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
///