Fill Testing Gaps highlighted by Community Toolkit
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
The Community Toolkit has copy and pasted a bunch of internal testing code from the aspire repo to allow it to do tests - https://github.com/CommunityToolkit/Aspire/tree/main/tests/CommunityToolkit.Aspire.Testing .
But if it's having to copy & paste code rather than using the `Aspire.Hosting.Testing` nuget package, that suggests there are gaps in the Aspire testing story which should be filled.
### Describe the solution you'd like
- `DockerUtils.AttemptDeleteDockerVolume` - this feels like something that would be useful to expose. Not only for testing scenarios, but it could also be useful for exposing "Reset" capabilities from custom commands. There could also be a higher level option for `DistributedApplicationTestingBuilderOptions` along the lines of `ResetVolumes` that would cause it to automatically reset all volumes involved in a test
- `LoggerNotificationExtensions.WaitForTextAsync` - This can probably be added to `ResourceNotificationService`. Again this would probably be useful outside of testings (e.g. writing a custom health check for a custom resource that doesn't expose any external method to check it's health)
- `TestDistributedApplicationBuilder.Create(DistributedApplicationOperation operation)` - it's a bit clunky doing tests in publish mode. There should be some overloads of `DistributedApplicationTestingBuilder` or extension methods to make doing tests with publish mode easier.
There are also a bunch of xUnit integration things - I could see these eventually becoming an `Aspire.Hosting.Testing.Xunit` package, although I'm not sure the testing story has matured enough to provide such opinionated test framework integrations at this time.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.