Skip to content

Allow starting and stopping resources from unit tests. #6455

Open
@mitchdenny

Description

@mitchdenny

In #6425 I had to hack around the fact that we don't provide a mechanism in extension packages to start and stop a resource during the lifetime of the AppHost. This came up because in #6425 I needed to spin up two app hosts sequentially to test the container lifetime behavior.

To work around the issue I added an ApplicationExecutorProxy to Aspire.Hosting.Tests which allowed me to call these methods but this is really just a temporary measure so we don't block tests for this feature in shipping .NET 9.0.

Once we ship 9.0, we should look at doing work in 9.x to allow greater control of the lifecycle of individual resources. I think that there are probably two separate angles of attack here (and we may want to do both of them).

  • Support triggering execution of Commands against resources to allow hosting integration developers to test their custom custom commands (if we had this I could have done what I wanted by triggering the stop command).
  • Make sure that as part of Orchestrator & Operators #6040 that we can have more fine grained control over resource lifecycles from integration package unit tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-testingIssues pertaining to the APIs in Aspire.Hosting.Testing

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions