Use MemoryStream instead of stdout for outgoing messages during integration tests (#1696)

* filter

* test

* run all

* Redirect to memorystream

* revert temp changes
This commit is contained in:
Charles Gagnon
2022-09-16 15:38:53 -07:00
committed by GitHub
parent 006ac60923
commit 019481e8db
6 changed files with 24 additions and 15 deletions

View File

@@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
@@ -188,8 +189,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
var hostDetails = new HostDetails(hostName, hostProfileId, hostVersion);
SqlToolsContext sqlToolsContext = new SqlToolsContext(hostDetails);
// Grab the instance of the service host
ServiceHost serviceHost = HostLoader.CreateAndStartServiceHost(sqlToolsContext);
// Initialize the ServiceHost, using a MemoryStream for the output stream so that we don't fill up the logs
// with a bunch of outgoing messages (which aren't used for anything during tests)
ServiceHost serviceHost = HostLoader.CreateAndStartServiceHost(sqlToolsContext, null, new MemoryStream());
}
}