Get information from running Aspire Hosts #11012
Unanswered
vandenbergjp
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hello @vandenbergjp, |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use Aspire together with my integration and end-to-end tests. When I use the DistributedApplicationTestingBuilder, a new Aspire host is started each time I run the tests. This is useful because it ensures the tests run in a fresh environment. However, it also slows things down, since the Aspire host takes time to start—annoying when running tests frequently.
To speed things up, I currently start the Aspire environment manually, keep it running, and run my tests against that instance. The downside is that I then need to configure static endpoints and connection strings and hard code those in my tests. My goal, however, is to keep things “Aspirefied.”
So here’s my question: is it possible to detect if an Aspire host is already running and 'connect' to it in order to retrieve resource information (like connection strings and endpoints)?
Ideally, I’d like to continue using the DistributedApplicationTestingBuilder, but have the option to either connect to an existing instance or spin up a new one—something similar to how you can configure containers with
.WithLifetime(ContainerLifetime.Persistent)
.Beta Was this translation helpful? Give feedback.
All reactions