Skip to content

Commit

Permalink
Using random app Id for dapr testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliscode committed Nov 11, 2024
1 parent c2583a1 commit 43c9e08
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ 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");
this._httpClient = new HttpClient();
await this.StartTestHostAsync();
}
Expand All @@ -37,7 +39,7 @@ private async Task StartTestHostAsync()
var processStartInfo = new ProcessStartInfo
{
FileName = "dapr",
Arguments = "run --app-id daprprocesstests --app-port 5200 --dapr-http-port 3500 -- dotnet run --urls http://localhost:5200",
Arguments = $"run --app-id {this._daprAppIdd!} --app-port 5200 --dapr-http-port 3500 -- dotnet run --urls http://localhost:5200",
WorkingDirectory = workingDirectory,
RedirectStandardOutput = false,
RedirectStandardError = false,
Expand All @@ -64,7 +66,7 @@ private async Task ShutdownTestHostAsync()
var processStartInfo = new ProcessStartInfo
{
FileName = "dapr",
Arguments = "stop --app-id daprprocesstests",
Arguments = $"stop --app-id {this._daprAppIdd}",
RedirectStandardOutput = false,
RedirectStandardError = false,
UseShellExecute = true,
Expand Down

0 comments on commit 43c9e08

Please sign in to comment.