Skip to content

Commit

Permalink
Updating .NET test infrastructure to allow path to config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed May 1, 2019
1 parent a0fc86c commit 16e2bc1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dotnet/test/common/Environment/EnvironmentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ public class EnvironmentManager
private EnvironmentManager()
{
string currentDirectory = this.CurrentDirectory;
string content = File.ReadAllText(Path.Combine(currentDirectory, "appconfig.json"));
string configFile = TestContext.Parameters.Get("ConfigFile", string.Empty);
if (string.IsNullOrEmpty(configFile))
{
configFile = Path.Combine(currentDirectory, "appconfig.json");
}

string content = File.ReadAllText(configFile);
TestEnvironment env = JsonConvert.DeserializeObject<TestEnvironment>(content);

string activeDriverConfig = TestContext.Parameters.Get("ActiveDriverConfig", env.ActiveDriverConfig);
Expand All @@ -40,7 +46,7 @@ private EnvironmentManager()
urlBuilder = new UrlBuilder(websiteConfig);

DirectoryInfo info = new DirectoryInfo(currentDirectory);
while (info != info.Root && string.Compare(info.Name, "buck-out", StringComparison.OrdinalIgnoreCase) != 0 && string.Compare(info.Name, "build", StringComparison.OrdinalIgnoreCase) != 0)
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;
}
Expand Down

0 comments on commit 16e2bc1

Please sign in to comment.