Agent Tests for API, MAUI, and Slop Features
This commit is contained in:
@@ -32,18 +32,15 @@ public static class LocalServer
|
||||
};
|
||||
|
||||
var tcs = new TaskCompletionSource<string>();
|
||||
|
||||
|
||||
_process.OutputDataReceived += (s, e) =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(e.Data)) return;
|
||||
Console.WriteLine($"[SERVER] {e.Data}");
|
||||
var match = Regex.Match(e.Data, @"Now listening on:\s+(http://127.0.0.1:\d+)");
|
||||
if (match.Success)
|
||||
{
|
||||
tcs.TrySetResult(match.Groups[1].Value);
|
||||
}
|
||||
if (match.Success) tcs.TrySetResult(match.Groups[1].Value);
|
||||
};
|
||||
|
||||
|
||||
_process.ErrorDataReceived += (s, e) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(e.Data))
|
||||
@@ -55,8 +52,8 @@ public static class LocalServer
|
||||
_process.BeginErrorReadLine();
|
||||
|
||||
// Wait for the URL to be parsed from output
|
||||
BaseUrl = await Task.WhenAny(tcs.Task, Task.Delay(30000)) == tcs.Task
|
||||
? tcs.Task.Result
|
||||
BaseUrl = await Task.WhenAny(tcs.Task, Task.Delay(30000)) == tcs.Task
|
||||
? tcs.Task.Result
|
||||
: null;
|
||||
|
||||
if (BaseUrl == null)
|
||||
@@ -64,7 +61,7 @@ public static class LocalServer
|
||||
Stop();
|
||||
throw new Exception("Timeout waiting for local server to start and provide a URL.");
|
||||
}
|
||||
|
||||
|
||||
Console.WriteLine($"[DEBUG_LOG] Local server started at: {BaseUrl}");
|
||||
}
|
||||
|
||||
@@ -88,7 +85,7 @@ public static class LocalServer
|
||||
if (parent == current) break;
|
||||
current = parent;
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(current) || !File.Exists(Path.Combine(current, "IGP.sln")))
|
||||
{
|
||||
// Fallback to searching up from current directory if BaseDirectory fails
|
||||
@@ -103,4 +100,4 @@ public static class LocalServer
|
||||
|
||||
return current ?? throw new Exception("Could not find project root containing IGP.sln");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user