Replies: 2 comments 27 replies
-
To make sure you can run tests concurrently and to avoid port usage issues when tests start and stop.
If you don't hard code ports but instead resolve it from the resource it should work. Are you hard coding the port somewhere in your application? You can turn off port randomization as well, but you probably also want to turn off test concurrency. cc @ReubenBond |
Beta Was this translation helpful? Give feedback.
-
Is there a way to just resolve these directly? We're using OpenIddict and you have to set the issuer and it must be the exactly thing that the issuer responds with, which is the actual URL that it is on with port, not the virtual name: https://accounts. I need https://localhost:3424 (or whatever port was randomly assigned) and I need to keep random assignment. |
Beta Was this translation helpful? Give feedback.
-
I've created an Aspire-Xunit integration test project that is doing the following to create an app host off my Aspire project:
var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.CopilotFlow_LocalHost_StartHere>(); await using var app = await appHost.BuildAsync();
The Aspire project starts up three services:
builder.AddProject<Projects.CopilotFlow_LocalHelper_Service>($"{targetEnvironment}LocalHelperService"); builder.AddProject<Projects.Microsoft_PowerAutomate_CopilotFlow_Web_Service>($"{targetEnvironment}WebService"); builder.AddProject<Projects.Microsoft_PowerAutomate_CopilotFlow_Worker_Service>($"{targetEnvironment}WorkerService");
The issue is that the WebService requires a call to the LocalHelper_Service at a specific configured port. i.e. localhost:1234. But the code in the integration test using the DistributedApplicationTestingBuilder assigns a random port to the LocalHelper_Service.
So I have two questions.
Beta Was this translation helpful? Give feedback.
All reactions