Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support testing Aspire-orchestrated services #416

Closed
captainsafia opened this issue Oct 20, 2023 · 3 comments
Closed

Support testing Aspire-orchestrated services #416

captainsafia opened this issue Oct 20, 2023 · 3 comments

Comments

@captainsafia
Copy link
Member

While working on implementing functional tests in big eShop, the requirement to run service dependencies under test came up. For example, functional tests for the Catalog API require that a Postgres database is instantiated.

In Aspire. we currently achieve this by implementing a test fixture that launches an Aspire app host with a Postgres resource and passing the connection string of the instantiated database resource to the service's host.

While this strategy works, there's a few noticeable drawbacks:

  • DCP makes assumptions about how the Aspire host is instantiated, in particular requiring that the Aspire orchestrator is executing the app host. See https://github.com/dotnet-architecture/eShop/pull/218 for more info.
  • We need to configure an entire app host when in reality we want to launch a collection of resources independent of it, a model similar to test containers.

How should we think about providing an integration testing experience for developers building Aspire-orchestrated services?

@captainsafia
Copy link
Member Author

captainsafia commented Oct 27, 2023

This is pretty close but:

DCP makes assumptions about how the Aspire host is instantiated, in particular requiring that the Aspire orchestrator is executing the app host. See https://github.com/dotnet-architecture/eShop/pull/218 for more info.

Is the last remaining pickle. In the Aspire 💚 Testing chat, we discussed a possible solution to this which is adding a new DistributedApplicationOptions.AssemblyName options to support overriding how the DCP lookup happens.

cc: @danegsta @davidfowl

@davidfowl
Copy link
Member

@captainsafia can close this one?

@danegsta
Copy link
Member

danegsta commented Nov 2, 2023

This should be resolved by the new AssemblyName option and temp path changes. Please re-open if there are further issues that are still blocking test scenarios.

@danegsta danegsta closed this as completed Nov 2, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants