Test
This commit is contained in:
@@ -11,7 +11,7 @@ public class TestSetup
|
||||
[OneTimeSetUp]
|
||||
public async Task BeforeAllTests()
|
||||
{
|
||||
Console.WriteLine("[DEBUG_LOG] Starting Cloud...");
|
||||
Console.WriteLine("[DEBUG_LOG] Starting Web server...");
|
||||
|
||||
// Find solution root
|
||||
var currentDir = AppContext.BaseDirectory;
|
||||
@@ -20,12 +20,12 @@ public class TestSetup
|
||||
|
||||
if (currentDir == null) throw new Exception("Could not find Chrono.sln to determine project path.");
|
||||
|
||||
var projectPath = Path.Combine(currentDir, "Cloud", "Cloud.csproj");
|
||||
var projectPath = Path.Combine(currentDir, "Web", "Web.csproj");
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = "dotnet",
|
||||
Arguments = $"run --project \"{projectPath}\" --no-build",
|
||||
Arguments = $"run --project \"{projectPath}\" --urls \"{ServerUrl}\" --no-build",
|
||||
RedirectStandardOutput = true,
|
||||
RedirectStandardError = true,
|
||||
UseShellExecute = false,
|
||||
@@ -71,10 +71,10 @@ public class TestSetup
|
||||
if (!isReady)
|
||||
{
|
||||
_serverProcess.Kill(true);
|
||||
throw new Exception($"Cloud did not start within {timeout.TotalSeconds} seconds.");
|
||||
throw new Exception($"Web server did not start within {timeout.TotalSeconds} seconds.");
|
||||
}
|
||||
|
||||
Console.WriteLine("[DEBUG_LOG] Cloud is ready.");
|
||||
Console.WriteLine("[DEBUG_LOG] Web server is ready.");
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
@@ -82,7 +82,7 @@ public class TestSetup
|
||||
{
|
||||
if (_serverProcess != null && !_serverProcess.HasExited)
|
||||
{
|
||||
Console.WriteLine("[DEBUG_LOG] Stopping Cloud...");
|
||||
Console.WriteLine("[DEBUG_LOG] Stopping Web server...");
|
||||
_serverProcess.Kill(true);
|
||||
_serverProcess.Dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user