Document MTP message bus file artifacts and correct stale extension APIs#54824
Open
Evangelink wants to merge 2 commits into
Open
Document MTP message bus file artifacts and correct stale extension APIs#54824Evangelink wants to merge 2 commits into
Evangelink wants to merge 2 commits into
Conversation
Addresses microsoft/testfx issue #3261. Updates the MTP extensions and test framework articles to match current testfx main: Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77cb3512-ac1c-45cc-a0c8-3c583c919e8e
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Microsoft.Testing.Platform (MTP) architecture documentation to reflect current extension APIs and to clearly document how file artifacts flow through the message bus (run/session-level vs. test-level attachments), addressing the “Message Bus Artifacts” gap.
Changes:
- Corrects stale extension API documentation for
ITestSessionLifetimeHandlerandIDataConsumer, including MTP v1→v2 notes. - Adds a new “Message bus file artifacts” section that explains how to publish
FileArtifact/SessionFileArtifactand how to attach per-test files viaFileArtifactProperty. - Updates the test framework article’s artifact guidance to align with the new file-artifact model and cross-links to the extensions article.
Show a summary per file
| File | Description |
|---|---|
| docs/core/testing/microsoft-testing-platform-architecture-test-framework.md | Replaces the stale artifact paragraph with accurate guidance for run/session vs. test-specific file attachments and links to the new extensions section. |
| docs/core/testing/microsoft-testing-platform-architecture-extensions.md | Updates extension API signatures/relationships for MTP v2 and adds detailed documentation for message bus file artifacts (including versioned notes and examples). |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
| } | ||
| ``` | ||
|
|
||
| To attach a file to a *specific test* so that the terminal, `dotnet test`, and IDEs associate and display it with that test, don't publish a stand-alone file artifact. Instead, add one or more `FileArtifactProperty` entries to the `TestNode` that your [testing framework](./microsoft-testing-platform-architecture-test-framework.md#test-framework-extension) reports through a [`TestNodeUpdateMessage`](./microsoft-testing-platform-architecture-test-framework.md#the-testnodeupdatemessage-data). `FileArtifactProperty` was introduced in MTP 1.7.0: |
Member
Author
There was a problem hiding this comment.
Good catch — fixed in 35f425c. Changed \stand-alone\ to \standalone\ to match usage elsewhere in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 77cb3512-ac1c-45cc-a0c8-3c583c919e8e
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.
Summary
Addresses microsoft/testfx#3261 (Message Bus Artifacts). The MTP extensions article was stale relative to current
microsoft/testfxmain; this PR corrects the affected extension APIs and adds a complete "Message bus file artifacts" section. It also fixes a related incorrect artifact paragraph in the test framework article.All API details were verified directly against
microsoft/testfxmainsource.Changes to
microsoft-testing-platform-architecture-extensions.mdITestSessionLifetimeHandler: fixed theLifeTimemisspelling; corrected the interface snippet soOnTestSessionStartingAsync/OnTestSessionFinishingAsynceach take anITestSessionContext(exposingSessionUid+CancellationToken); added an MTP 2.0.0 version note.IDataConsumer: base interfaceITestHostExtension→IExtension; noted the MTP 2.0.0 move to theMicrosoft.Testing.Platform.Extensionsnamespace;ConsumeAsyncprose "pushed onto" → "published to".IMessageBus.Pushparagraph with accuratePublishAsyncbackground-loop behavior; documented the experimentalIBlockingDataConsumer(MTP 2.3.0) including the reentrant-publish deadlock caveat; fixed a mistypedITestHostProcessLifetimeHandlerlink →ITestSessionLifetimeHandler.IDatahas no automatic output without a matching consumer;FileArtifact(unscoped) vsSessionFileArtifact(run/session-scoped); recognition by the built-in terminal anddotnet testconsumers; test-level files asFileArtifactPropertyon theTestNodeinsideTestNodeUpdateMessage; removedTestNodeFileArtifact; producer/file ownership and identity; the in-process-onlyIDataConsumerregistration boundary; and the experimental MTP 2.4.0 (unreleased as of July 2026)Kindmetadata contract. Includes compile-realistic snippets.Changes to
microsoft-testing-platform-architecture-test-framework.mdFileArtifact/SessionFileArtifactare standalone bus messages, while test-specific attachments areFileArtifactPropertyentries onTestNode.PropertiesinsideTestNodeUpdateMessage. Cross-linked to the new extensions subsection and preserved theDataTypesProducedsample.Both articles:
ms.dateupdated;ai-usage: ai-assisted.Validation
markdownlint-cli2(repo.markdownlint-cli2.jsonc): 0 errors on both files.git diff --check: clean.Note
Version tags for pre-release APIs (MTP 2.4.0
Kind, 2.3.0IBlockingDataConsumer) are drawn from the changelog's unreleased/next section; the 2.4.0Kindnote is explicitly marked "unreleased as of July 2026".This documentation was created with the assistance of AI (
ai-usage: ai-assisted).Internal previews