microsoft / microsoft/aspire

Skip Interactive resources when running tests

Open
#15,264 0 comments 0 reactions 0 assignees View on GitHub
area-testing
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.

When running tests against an app host with `DistributedApplicationBuilder` in CI, I'm noticing a not insignificant amount of time gets spent spinning up interactive dev tools (e.g. php myadmin, redis insights, dbgate etc.)

This is particularly painful on CI machines as they are often ephemeral machines (so you have to pay the cost of pulling images), and are often lower spec than developer machines, so may be suffering more from resource contention on app host startup. So spending time starting them up can add non trivial times in CI, whilst also adding unnecessary noise in logs.

### Describe the solution you'd like

Some kind of solution to automatically disable a resource if being started up in a non interactive manner such as tests. (Maybe by repurposing the `DisableDashboard` option as a more general `IsInteractive` option?)

There would need to be a way to override this. (e.g. if you are the author of such an interactive tool and want to write tests around the integration). Maybe by treatign it similar to `WithExplicitStart()`

Built in interactive resources (such as php my admin, redis commander redis insights) should have this capability enabled by default. And so too should some Community Toolkit resources (e.g. dbgate)

### Additional context

Contributor guide

Open the contributing guide

Research direction

Start with DistributedApplicationBuilder and trace how resources are identified and started during tests. Determine how a non-interactive test mode could skip interactive resources while allowing an explicit override. Done means built-in and selected Community Toolkit interactive resources are skipped by default in tests, with a documented way to start them when needed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.