Issue #34: handle worktree roots in live smoke tests
This commit is contained in:
@@ -37,7 +37,7 @@ public static class IntegrationTestEnvironment
|
||||
return Path.GetFullPath(configuredPath);
|
||||
}
|
||||
|
||||
string repositoryRoot = ResolveRepositoryRoot();
|
||||
string repositoryRoot = ResolveRepositoryRoot(AppContext.BaseDirectory);
|
||||
string[] candidatePaths =
|
||||
[
|
||||
Path.Combine(repositoryRoot, "src", "MxGateway.Worker", "bin", "x86", "Debug", "net48", "MxGateway.Worker.exe"),
|
||||
@@ -74,12 +74,13 @@ public static class IntegrationTestEnvironment
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
private static string ResolveRepositoryRoot()
|
||||
internal static string ResolveRepositoryRoot(string startDirectory)
|
||||
{
|
||||
DirectoryInfo? directory = new(AppContext.BaseDirectory);
|
||||
DirectoryInfo? directory = new(startDirectory);
|
||||
while (directory is not null)
|
||||
{
|
||||
if (Directory.Exists(Path.Combine(directory.FullName, ".git"))
|
||||
if ((Directory.Exists(Path.Combine(directory.FullName, ".git"))
|
||||
|| File.Exists(Path.Combine(directory.FullName, ".git")))
|
||||
&& Directory.Exists(Path.Combine(directory.FullName, "src")))
|
||||
{
|
||||
return directory.FullName;
|
||||
|
||||
Reference in New Issue
Block a user