[docs] Document recursive MTP test runner invocation guard in testing docs - #1804
Draft
aspire-repo-bot[bot] wants to merge 1 commit into
Draft
aspire-repo-bot[bot] wants to merge 1 commit into
aspire-repo-bot[bot] wants to merge 1 commit into
Conversation
Adds a troubleshooting section to the advanced testing scenarios page explaining why Aspire.AppHost.Sdk test projects can recursively invoke the test runner via DistributedApplicationTestingBuilder.CreateAsync, and how to fix it (Microsoft.NET.Sdk + ProjectReference, dynamic assembly loading, or DistributedApplicationTestingBuilder.Create()). Documents microsoft/aspire#20573 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 of 14 tasks
Contributor
Author
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents changes from microsoft/aspire#20573
@danegstaTarget branch: Targeting
release/17.0based on the source PR milestone17.0(exact match onmicrosoft/aspire.dev).Why this is needed
microsoft/aspire#20573 adds a safety check to
DistributedApplicationTestingBuilder.CreateAsyncthat detects when a Microsoft.Testing.Platform test project is itself built withAspire.AppHost.Sdk. In that situation the generatedProjects.*type can belong to the test application instead of the AppHost, and invoking its entry point recursively re-runs the entire test suite (potentially leaving stray AppHost/DCP processes running). The fix throws a clearInvalidOperationExceptioninstead of silently recursing.This is a new, previously undocumented failure mode and diagnostic message that users of
DistributedApplicationTestingBuildercan now hit, so the testing docs need to explain the symptom and the fix.What changed
Added a new "Avoid building test projects with
Aspire.AppHost.Sdk" section tosrc/frontend/src/content/docs/testing/advanced-scenarios.mdx(alongside the existing "File-based AppHost limitations" section), covering:Aspire.AppHost.Sdkinstead ofMicrosoft.NET.Sdk.InvalidOperationExceptionmessage users will see.Microsoft.NET.Sdkwith a<ProjectReference>to the AppHost, load the AppHost assembly dynamically and pass a type toCreateAsync(Type), or useDistributedApplicationTestingBuilder.Create()when no entry-point invocation is needed.Files modified
src/frontend/src/content/docs/testing/advanced-scenarios.mdx(updated)No new pages were created; this extends an existing troubleshooting-style page that already documents a related AppHost-testing limitation.