Skip to content

[Testing] Populate AppHost environment from launch profile and support launch profile override #7447

Merged
davidfowl merged 1 commit intomainfrom
rebond/rerevert-testing-launchprofile
Feb 7, 2025
Merged

[Testing] Populate AppHost environment from launch profile and support launch profile override #7447
davidfowl merged 1 commit intomainfrom
rebond/rerevert-testing-launchprofile

Conversation

@ReubenBond
Copy link
Copy Markdown
Member

@ReubenBond ReubenBond commented Feb 7, 2025

Description

Fixes #5093

This PR simulates launch profile loading for the testing host. It does not mutate the process' environment since that could cause issues with concurrently running tests. Instead, it propagates the environment variables specified in the AppHost's launch profile to the AppHost's configuration.

This PR sets the DOTNET_LAUNCH_PROFILE environment variable to the name of the first launch profile if not overridden. It does not consider the DOTNET_LAUNCH_PROFILE from the test runner's environment.

This re-applies #7363, which was reverted in #7371

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

@davidfowl davidfowl merged commit 997ba09 into main Feb 7, 2025
@davidfowl davidfowl deleted the rebond/rerevert-testing-launchprofile branch February 7, 2025 02:16
davidfowl added a commit that referenced this pull request Feb 7, 2025
…d allow launch profile override (#7363) (#7447)"

This reverts commit 997ba09.
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 9, 2025
@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aspire.Hosting.Testing should populate DOTNET_LAUNCH_PROFILE

2 participants