Skip to content

Make it eaiser to see Application state in tests when debugging DistributedApplicationTestingBuilder #5632

@afscrome

Description

@afscrome

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Currently if you are trying to troubleshoot an application state issue in tests run with DistributedApplicationTestingBuilder, you have limited information available around the current state of the application (e.g. has one of my resources died early).

Describe the solution you'd like

One option could be to do something with a DebuggerTypeProxy to provide a view similar to the Resources view on the Aspire dashboard. You could then hover over the app variable to get some of the information you'd otherwise get from the dashboard.

await using var app = await appHost.BuildAsync();
await app.StartAsync();

image

Another aid could be to add a WithDashboard method to DistributedApplicationTestingBuilder. When this is specified, the dashboard would be spun up allowing you to use the data on the dashboard for debugging. (Although this could get awkward quickly if the dashboard freezes whenever the debugger for the test is paused)

Additional context

Note, these suggestions only help with local dev when you can hook up a debugger. These don't help with debugging in CI systems (unless you can repro the same issue locally and debug there).

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions