mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Adding TestDriver project and CodeCoverage folder to the main solution (#133)
This will make it much easier for Visual Studio users to validate the TestDriver project. * Adding TestDriver project and CodeCoverage folder to the main solution * Adding fallback value for service layer exe path to allow tests to run in Visual Studio
This commit is contained in:
@@ -28,15 +28,9 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
|
||||
|
||||
public const string CodeCoverageToolEnvironmentVariable = "CODECOVERAGETOOL";
|
||||
|
||||
public const string CodeCoverageOutputEnvironmentVariable = "CODECOVERAGEOUTPUT";
|
||||
public const string CodeCoverageOutputEnvironmentVariable = "CODECOVERAGEOUTPUT";
|
||||
|
||||
/// <summary>
|
||||
/// Environment variable that stores the path to the service host executable.
|
||||
/// </summary>
|
||||
public static string ServiceHostEnvironmentVariable
|
||||
{
|
||||
get { return "SQLTOOLSSERVICE_EXE"; }
|
||||
}
|
||||
public const string ServiceHostEnvironmentVariable = "SQLTOOLSSERVICE_EXE";
|
||||
|
||||
public bool IsCoverageRun { get; set; }
|
||||
|
||||
@@ -44,6 +38,19 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Driver
|
||||
{
|
||||
string serviceHostExecutable = Environment.GetEnvironmentVariable(ServiceHostEnvironmentVariable);
|
||||
string serviceHostArguments = "--enable-logging";
|
||||
if (string.IsNullOrWhiteSpace(serviceHostExecutable))
|
||||
{
|
||||
// Include a fallback value to for running tests within visual studio
|
||||
serviceHostExecutable =
|
||||
@"..\..\src\Microsoft.SqlTools.ServiceLayer\bin\Debug\netcoreapp1.0\win7-x64\Microsoft.SqlTools.ServiceLayer.exe";
|
||||
}
|
||||
|
||||
// Make sure it exists before continuing
|
||||
if (!File.Exists(serviceHostExecutable))
|
||||
{
|
||||
throw new FileNotFoundException($"Failed to find Microsoft.SqlTools.ServiceLayer.exe at provided location '{serviceHostExecutable}'. " +
|
||||
"Please set SQLTOOLSERVICE_EXE environment variable to location of exe");
|
||||
}
|
||||
|
||||
//setup the service host for code coverage if the envvar is enabled
|
||||
if (Environment.GetEnvironmentVariable(ServiceCodeCoverageEnvironmentVariable) == "True")
|
||||
|
||||
Reference in New Issue
Block a user