-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add generic MTP capability pages for diagnostics, test host deployment, and Microsoft.Extensions integration #54723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
docs/core/testing/microsoft-testing-platform-diagnostics.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| title: Microsoft.Testing.Platform (MTP) diagnostics | ||
| description: Learn about the MTP extensions that capture evidence, such as screen recordings, to help you diagnose a test run. | ||
| author: evangelink | ||
| ms.author: amauryleve | ||
| ms.date: 07/09/2026 | ||
| ai-usage: ai-assisted | ||
| --- | ||
|
|
||
| # Diagnostics | ||
|
|
||
| These extensions capture evidence during a test run so you can diagnose failures after the fact. Each extension requires an additional NuGet package, as described in each section. | ||
|
|
||
| > [!TIP] | ||
| > When using [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild) (included transitively by MSTest, NUnit, and xUnit runners), these extensions are auto-registered when you install their NuGet packages — no code changes needed. The manual registration specified in this article is only required if you disabled the auto-generated entry point by setting `<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>`. | ||
|
|
||
| For process-level diagnostics, see the related [Crash and hang dumps](microsoft-testing-platform-crash-hang-dumps.md) extensions, which collect process dump files when the test host crashes or hangs. | ||
|
|
||
| ## Video recorder | ||
|
|
||
| The video recorder records the screen while your tests run and attaches the captured videos to the test session as artifacts. Recording is opt-in per run and driven by an external `ffmpeg` process, which must be available on the `PATH` or set through an explicit path. This extension requires the [Microsoft.Testing.Extensions.VideoRecorder](https://nuget.org/packages/Microsoft.Testing.Extensions.VideoRecorder) NuGet package. | ||
|
|
||
| > [!NOTE] | ||
| > Available in MTP starting with version 2.3.0. This extension is experimental, and its options and output format might change in a future version. | ||
|
|
||
| ### Manual registration | ||
|
|
||
| ```csharp | ||
| var builder = await TestApplication.CreateBuilderAsync(args); | ||
| builder.AddVideoRecorderProvider(); | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| | Option | MTP version | Description | | ||
| |---|---|---| | ||
| | `--capture-video` | 2.3.0 | Enables screen recording. The optional value controls retention: `on-failure` (default) keeps footage only for failing tests, and `always` keeps footage for every test. | | ||
| | `--capture-video-source` | 2.3.0 | Sets the capture source. Valid values are `screen` (default) and `window`. Requires `--capture-video`. | | ||
| | `--capture-video-granularity` | 2.3.0 | Sets whether the recorder produces one video per test or one chaptered video for the whole run. Valid values are `test` (default) and `session`. Requires `--capture-video`. | | ||
| | `--capture-video-max-duration` | 2.3.0 | Bounds disk usage on long runs by keeping approximately the last N seconds of footage. The value is a positive integer number of seconds. Requires `--capture-video`. | | ||
| | `--capture-video-chapters` | 2.3.0 | Sets whether chapter bookmarks are added to the per-session video. Valid values are `on` (default) and `off`. Requires `--capture-video`. | | ||
| | `--capture-video-args` | 2.3.0 | Passes extra arguments to the underlying recorder (`ffmpeg`). Requires `--capture-video`. | |
31 changes: 31 additions & 0 deletions
31
docs/core/testing/microsoft-testing-platform-extensions-integration.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| title: Microsoft.Extensions integration | ||
| description: Learn about the MTP extensions that bridge Microsoft.Testing.Platform to the Microsoft.Extensions.* libraries your application already uses. | ||
| author: evangelink | ||
| ms.author: amauryleve | ||
| ms.date: 07/09/2026 | ||
| ai-usage: ai-assisted | ||
| --- | ||
|
|
||
| # Microsoft.Extensions integration | ||
|
|
||
| These extensions bridge Microsoft.Testing.Platform (MTP) to the `Microsoft.Extensions.*` libraries your application already uses, so platform and extension components flow through the same infrastructure as the rest of your code. Each extension requires an additional NuGet package, as described in each section. | ||
|
|
||
| > [!TIP] | ||
| > When using [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild) (included transitively by MSTest, NUnit, and xUnit runners), these extensions are auto-registered when you install their NuGet packages — no code changes needed. The manual registration specified in this article is only required if you disabled the auto-generated entry point by setting `<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>`. | ||
|
|
||
| ## Logging bridge | ||
|
|
||
| The logging bridge forwards Microsoft.Testing.Platform diagnostic logs to <xref:Microsoft.Extensions.Logging.ILogger>, so platform and extension logs flow through the same `Microsoft.Extensions.Logging` pipeline your application already uses. You can reuse an existing logging stack — Console, Debug, Serilog, Application Insights, OpenTelemetry, or a custom `ILoggerProvider` — without writing a custom MTP logger provider. This extension requires the [Microsoft.Testing.Extensions.Logging](https://nuget.org/packages/Microsoft.Testing.Extensions.Logging) NuGet package. | ||
|
|
||
| > [!NOTE] | ||
| > Available in MTP starting with version 2.3.0. This extension is experimental, and its options and output format might change in a future version. | ||
|
|
||
| The bridge forwards each message only when the platform's diagnostic logging is enabled. When the platform's effective log level is `None` (the default, unless you pass [`--diagnostic`](microsoft-testing-platform-cli-options.md)), the configuration delegate isn't invoked and no logger factory is created. Per-category filters that you set in the `ILoggingBuilder` can narrow the platform's effective diagnostic level, but they can't widen it. | ||
|
|
||
| ### Manual registration | ||
|
|
||
| ```csharp | ||
| var builder = await TestApplication.CreateBuilderAsync(args); | ||
| builder.AddMicrosoftExtensionsLogging(logging => logging.AddConsole()); | ||
| ``` | ||
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
29 changes: 29 additions & 0 deletions
29
docs/core/testing/microsoft-testing-platform-test-host-deployment.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| title: Microsoft.Testing.Platform (MTP) test host deployment | ||
| description: Learn about the MTP extensions that control how and where the test host is deployed and launched. | ||
| author: evangelink | ||
| ms.author: amauryleve | ||
| ms.date: 07/09/2026 | ||
| ai-usage: ai-assisted | ||
| --- | ||
|
|
||
| # Test host deployment | ||
|
|
||
| These extensions control how and where the test host is deployed and launched. They build on the experimental `ITestHostLauncher` extension point, which lets an extension take over the deployment and launch of the test host instead of starting it in place. Each extension requires an additional NuGet package, as described in each section. | ||
|
|
||
| > [!TIP] | ||
| > When using [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild) (included transitively by MSTest, NUnit, and xUnit runners), these extensions are auto-registered when you install their NuGet packages — no code changes needed. The manual registration specified in this article is only required if you disabled the auto-generated entry point by setting `<GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>`. | ||
|
|
||
| ## Packaged app deployment | ||
|
|
||
| The packaged app deployment extension deploys a packaged Windows test host (UWP or packaged WinUI) into an isolated directory and launches it from there, rather than starting the test host in place. It's the reference consumer of the experimental `ITestHostLauncher` extension point for packaged Windows apps. This extension requires the [Microsoft.Testing.Extensions.PackagedApp](https://nuget.org/packages/Microsoft.Testing.Extensions.PackagedApp) NuGet package. | ||
|
|
||
| > [!NOTE] | ||
| > Available in MTP starting with version 2.3.0. This extension is experimental, and its options and output format might change in a future version. | ||
|
|
||
| ### Manual registration | ||
|
|
||
| ```csharp | ||
| var builder = await TestApplication.CreateBuilderAsync(args); | ||
| builder.AddPackagedAppDeployment(); | ||
| ``` |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.