Skip to content

Commit

Permalink
trying more
Browse files Browse the repository at this point in the history
  • Loading branch information
alliscode committed Nov 11, 2024
1 parent 43c9e08 commit 5c25028
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ public sealed class ProcessTestFixture : IDisposable, IAsyncLifetime
{
private System.Diagnostics.Process? _process;
private HttpClient? _httpClient;
private string? _daprAppIdd;

/// <summary>
/// Called by xUnit before the test is run.
/// </summary>
/// <returns></returns>
public async Task InitializeAsync()
{
this._daprAppIdd = Guid.NewGuid().ToString("n");
if (this._process is not null && !this._process.HasExited)
{
return;
}

this._httpClient = new HttpClient();
await this.StartTestHostAsync();
}
Expand All @@ -35,11 +38,11 @@ private async Task StartTestHostAsync()
{
try
{
string workingDirectory = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"../../../../Process.IntegrationTestHost.Dapr"));
string workingDirectory = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "../../../../Process.IntegrationTestHost.Dapr"));
var processStartInfo = new ProcessStartInfo
{
FileName = "dapr",
Arguments = $"run --app-id {this._daprAppIdd!} --app-port 5200 --dapr-http-port 3500 -- dotnet run --urls http://localhost:5200",
Arguments = $"run --app-id daprprocesstests --app-port 5200 --dapr-http-port 3500 -- dotnet run --urls http://localhost:5200",
WorkingDirectory = workingDirectory,
RedirectStandardOutput = false,
RedirectStandardError = false,
Expand All @@ -66,7 +69,7 @@ private async Task ShutdownTestHostAsync()
var processStartInfo = new ProcessStartInfo
{
FileName = "dapr",
Arguments = $"stop --app-id {this._daprAppIdd}",
Arguments = $"stop --app-id daprprocesstests",
RedirectStandardOutput = false,
RedirectStandardError = false,
UseShellExecute = true,
Expand Down

0 comments on commit 5c25028

Please sign in to comment.