Skip to content

Document MTP message bus file artifacts and correct stale extension APIs#54824

Open
Evangelink wants to merge 2 commits into
mainfrom
dev/amauryleve/document-mtp-artifacts
Open

Document MTP message bus file artifacts and correct stale extension APIs#54824
Evangelink wants to merge 2 commits into
mainfrom
dev/amauryleve/document-mtp-artifacts

Conversation

@Evangelink

@Evangelink Evangelink commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

Addresses microsoft/testfx#3261 (Message Bus Artifacts). The MTP extensions article was stale relative to current microsoft/testfx main; 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/testfx main source.

Changes to microsoft-testing-platform-architecture-extensions.md

  • ITestSessionLifetimeHandler: fixed the LifeTime misspelling; corrected the interface snippet so OnTestSessionStartingAsync/OnTestSessionFinishingAsync each take an ITestSessionContext (exposing SessionUid + CancellationToken); added an MTP 2.0.0 version note.
  • IDataConsumer: base interface ITestHostExtensionIExtension; noted the MTP 2.0.0 move to the Microsoft.Testing.Platform.Extensions namespace; ConsumeAsync prose "pushed onto" → "published to".
  • Message bus semantics: replaced the incorrect async-only/IMessageBus.Push paragraph with accurate PublishAsync background-loop behavior; documented the experimental IBlockingDataConsumer (MTP 2.3.0) including the reentrant-publish deadlock caveat; fixed a mistyped ITestHostProcessLifetimeHandler link → ITestSessionLifetimeHandler.
  • New "Message bus file artifacts" section answering adding StackFrameExtensions apis #3261: custom IData has no automatic output without a matching consumer; FileArtifact (unscoped) vs SessionFileArtifact (run/session-scoped); recognition by the built-in terminal and dotnet test consumers; test-level files as FileArtifactProperty on the TestNode inside TestNodeUpdateMessage; removed TestNodeFileArtifact; producer/file ownership and identity; the in-process-only IDataConsumer registration boundary; and the experimental MTP 2.4.0 (unreleased as of July 2026) Kind metadata contract. Includes compile-realistic snippets.
  • Added v1→v2 migration guide links where natural.

Changes to microsoft-testing-platform-architecture-test-framework.md

  • Rewrote the stale artifact paragraph: FileArtifact/SessionFileArtifact are standalone bus messages, while test-specific attachments are FileArtifactProperty entries on TestNode.Properties inside TestNodeUpdateMessage. Cross-linked to the new extensions subsection and preserved the DataTypesProduced sample.

Both articles: ms.date updated; 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.0 IBlockingDataConsumer) are drawn from the changelog's unreleased/next section; the 2.4.0 Kind note is explicitly marked "unreleased as of July 2026".

This documentation was created with the assistance of AI (ai-usage: ai-assisted).


Internal previews

📄 File 🔗 Preview link
docs/core/testing/microsoft-testing-platform-architecture-extensions.md Build extensions for Microsoft.Testing.Platform (MTP)
docs/core/testing/microsoft-testing-platform-architecture-test-framework.md Build a test framework for Microsoft.Testing.Platform (MTP)

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
Copilot AI review requested due to automatic review settings July 17, 2026 13:32
@dotnetrepoman dotnetrepoman Bot added this to the July 2026 milestone Jul 17, 2026
@Evangelink
Evangelink enabled auto-merge (squash) July 17, 2026 13:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ITestSessionLifetimeHandler and IDataConsumer, including MTP v1→v2 notes.
  • Adds a new “Message bus file artifacts” section that explains how to publish FileArtifact/SessionFileArtifact and how to attach per-test files via FileArtifactProperty.
  • 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:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants