Skip to content

Commit

Permalink
Updating internal .NET test infrastructure to allow passing in suppor…
Browse files Browse the repository at this point in the history
…t paths
  • Loading branch information
jimevans committed May 3, 2019
1 parent f42c3cb commit 913cce4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 11 additions & 5 deletions dotnet/test/common/Environment/EnvironmentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,27 @@ private EnvironmentManager()

urlBuilder = new UrlBuilder(websiteConfig);

DirectoryInfo info = new DirectoryInfo(currentDirectory);
while (info != info.Root && string.Compare(info.Name, "bazel-out", StringComparison.OrdinalIgnoreCase) != 0 && string.Compare(info.Name, "buck-out", StringComparison.OrdinalIgnoreCase) != 0 && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
string projectRoot = TestContext.Parameters.Get("RootPath", string.Empty);
if (string.IsNullOrEmpty(projectRoot))
{
DirectoryInfo info = new DirectoryInfo(currentDirectory);
while (info != info.Root && string.Compare(info.Name, "bazel-out", StringComparison.OrdinalIgnoreCase) != 0 && string.Compare(info.Name, "buck-out", StringComparison.OrdinalIgnoreCase) != 0 && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
{
info = info.Parent;
}

info = info.Parent;
projectRoot = info.FullName;
}

info = info.Parent;
webServer = new TestWebServer(info.FullName);
webServer = new TestWebServer(projectRoot);
bool autoStartRemoteServer = false;
if (browser == Browser.Remote)
{
autoStartRemoteServer = driverConfig.AutoStartRemoteServer;
}

remoteServer = new RemoteSeleniumServer(info.FullName, autoStartRemoteServer);
remoteServer = new RemoteSeleniumServer(projectRoot, autoStartRemoteServer);
}

~EnvironmentManager()
Expand Down
4 changes: 3 additions & 1 deletion dotnet/test/common/Environment/TestWebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ public void Start()
javaExecutableName = javaExecutableName + ".exe";
}

string processArgs = string.Format("-Duser.dir={0} -cp {1} {2}", projectRootPath, standaloneTestJar, webserverClassName);

webserverProcess = new Process();
webserverProcess.StartInfo.FileName = javaExecutableName;
webserverProcess.StartInfo.Arguments = "-cp " + standaloneTestJar + " " + webserverClassName;
webserverProcess.StartInfo.Arguments = processArgs;
webserverProcess.StartInfo.WorkingDirectory = projectRootPath;
webserverProcess.Start();
DateTime timeout = DateTime.Now.Add(TimeSpan.FromSeconds(30));
Expand Down

0 comments on commit 913cce4

Please sign in to comment.