Skip to content

Commit 99fb6d5

Browse files
EvangelinkCopilot
andauthored
Add generic MTP capability pages for diagnostics, test host deployment, and Microsoft.Extensions integration (dotnet#54723)
Promote the experimental video recorder, packaged-app deployment, and logging-bridge extensions from inline blurbs in features.md into dedicated, generically named capability pages that can host multiple extensions over time. Update features.md links, the Choose by scenario list, and the TOC. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 681d32f commit 99fb6d5

6 files changed

Lines changed: 120 additions & 20 deletions

.openpublishing.redirection.core.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,11 +1925,6 @@
19251925
"source_path_from_root": "/docs/core/testing/unit-testing-platform-diagnostics.md",
19261926
"redirect_url": "/dotnet/core/testing/microsoft-testing-platform-crash-hang-dumps"
19271927
},
1928-
{
1929-
"source_path_from_root": "/docs/core/testing/microsoft-testing-platform-diagnostics.md",
1930-
"redirect_url": "/dotnet/core/testing/microsoft-testing-platform-crash-hang-dumps",
1931-
"redirect_document_id": false
1932-
},
19331928
{
19341929
"source_path_from_root": "/docs/core/testing/unit-testing-platform-exit-codes.md",
19351930
"redirect_url": "/dotnet/core/testing/microsoft-testing-platform-troubleshooting#exit-codes"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Microsoft.Testing.Platform (MTP) diagnostics
3+
description: Learn about the MTP extensions that capture evidence, such as screen recordings, to help you diagnose a test run.
4+
author: evangelink
5+
ms.author: amauryleve
6+
ms.date: 07/09/2026
7+
ai-usage: ai-assisted
8+
---
9+
10+
# Diagnostics
11+
12+
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.
13+
14+
> [!TIP]
15+
> 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>`.
16+
17+
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.
18+
19+
## Video recorder
20+
21+
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.
22+
23+
> [!NOTE]
24+
> 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.
25+
26+
### Manual registration
27+
28+
```csharp
29+
var builder = await TestApplication.CreateBuilderAsync(args);
30+
builder.AddVideoRecorderProvider();
31+
```
32+
33+
### Options
34+
35+
| Option | MTP version | Description |
36+
|---|---|---|
37+
| `--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. |
38+
| `--capture-video-source` | 2.3.0 | Sets the capture source. Valid values are `screen` (default) and `window`. Requires `--capture-video`. |
39+
| `--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`. |
40+
| `--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`. |
41+
| `--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`. |
42+
| `--capture-video-args` | 2.3.0 | Passes extra arguments to the underlying recorder (`ffmpeg`). Requires `--capture-video`. |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Microsoft.Testing.Platform (MTP) Microsoft.Extensions integration
3+
description: Learn about the MTP extensions that bridge Microsoft.Testing.Platform to the Microsoft.Extensions.* libraries your application already uses.
4+
author: evangelink
5+
ms.author: amauryleve
6+
ms.date: 07/09/2026
7+
ai-usage: ai-assisted
8+
---
9+
10+
# Microsoft.Extensions integration
11+
12+
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.
13+
14+
> [!TIP]
15+
> 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>`.
16+
17+
## Logging bridge
18+
19+
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.
20+
21+
> [!NOTE]
22+
> 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.
23+
24+
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.
25+
26+
### Manual registration
27+
28+
```csharp
29+
var builder = await TestApplication.CreateBuilderAsync(args);
30+
builder.AddMicrosoftExtensionsLogging(logging => logging.AddConsole());
31+
```

docs/core/testing/microsoft-testing-platform-features.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Use the following path based on your goal:
3434
- Need GitHub Actions-native output (log groups, annotations, and job summary): [GitHub Actions report](./microsoft-testing-platform-test-reports.md#github-actions-reports) (extension, experimental)
3535
- Need coverage data: [Code coverage](./microsoft-testing-platform-code-coverage.md) (extension)
3636
- Need crash or hang diagnostics: [Crash and hang dumps](./microsoft-testing-platform-crash-hang-dumps.md) (extension)
37+
- Need to record the screen during a run: [Diagnostics](./microsoft-testing-platform-diagnostics.md) (extension, experimental)
38+
- Need to deploy and launch a packaged-app test host: [Test host deployment](./microsoft-testing-platform-test-host-deployment.md) (extension, experimental)
39+
- Need to route platform logs through `Microsoft.Extensions.Logging`: [Microsoft.Extensions integration](./microsoft-testing-platform-extensions-integration.md) (extension, experimental)
3740
- Need to retry failed tests: [Retry](./microsoft-testing-platform-retry.md#retry) (extension)
3841
- Need hot reload support: [Hot Reload](./microsoft-testing-platform-hot-reload.md) (extension)
3942
- Need Microsoft Fakes support: [Microsoft Fakes](./microsoft-testing-platform-fakes.md) (extension)
@@ -84,23 +87,14 @@ Run tests that use Microsoft Fakes for stubs and shims.
8487

8588
Telemetry collection. Learn how to opt out and what data is collected.
8689

87-
**[Video recorder](https://www.nuget.org/packages/Microsoft.Testing.Extensions.VideoRecorder)** (experimental, introduced in MTP 2.3.0)
90+
**[Diagnostics](./microsoft-testing-platform-diagnostics.md)** (experimental, introduced in MTP 2.3.0)
8891

89-
Record the screen during a test run. It requires `ffmpeg` to be available on the machine and is enabled with the `--capture-video` option. Register it manually with `builder.AddVideoRecorderProvider()`.
92+
Capture evidence to diagnose a run, such as recording the screen with the video recorder.
9093

91-
**[Packaged app deployment](https://www.nuget.org/packages/Microsoft.Testing.Extensions.PackagedApp)** (experimental, introduced in MTP 2.3.0)
94+
**[Test host deployment](./microsoft-testing-platform-test-host-deployment.md)** (experimental, introduced in MTP 2.3.0)
9295

93-
A reference extension that uses the experimental `ITestHostLauncher` extension point to deploy and launch a packaged-app test host. Register it manually with `builder.AddPackagedAppDeployment()`.
96+
Control how and where the test host is deployed and launched, such as deploying and launching a packaged-app test host.
9497

95-
## Microsoft.Extensions integration
98+
**[Microsoft.Extensions integration](./microsoft-testing-platform-extensions-integration.md)** (experimental, introduced in MTP 2.3.0)
9699

97-
These extensions bridge Microsoft.Testing.Platform to the `Microsoft.Extensions.*` libraries your application already uses.
98-
99-
**[Logging bridge](https://www.nuget.org/packages/Microsoft.Testing.Extensions.Logging)** (experimental, introduced in MTP 2.3.0)
100-
101-
The Microsoft.Testing.Extensions.Logging package bridges Microsoft.Testing.Platform diagnostics to <xref:Microsoft.Extensions.Logging.ILogger>, so platform and extension logs flow through the same `Microsoft.Extensions.Logging` pipeline your application already uses. Register it manually with the following call:
102-
103-
```csharp
104-
var builder = await TestApplication.CreateBuilderAsync(args);
105-
builder.AddMicrosoftExtensionsLogging(logging => logging.AddConsole());
106-
```
100+
Bridge platform and extension diagnostics into the `Microsoft.Extensions.*` libraries your application already uses, such as forwarding logs through the `Microsoft.Extensions.Logging` pipeline.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Microsoft.Testing.Platform (MTP) test host deployment
3+
description: Learn about the MTP extensions that control how and where the test host is deployed and launched.
4+
author: evangelink
5+
ms.author: amauryleve
6+
ms.date: 07/09/2026
7+
ai-usage: ai-assisted
8+
---
9+
10+
# Test host deployment
11+
12+
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.
13+
14+
> [!TIP]
15+
> 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>`.
16+
17+
## Packaged app deployment
18+
19+
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.
20+
21+
> [!NOTE]
22+
> 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.
23+
24+
### Manual registration
25+
26+
```csharp
27+
var builder = await TestApplication.CreateBuilderAsync(args);
28+
builder.AddPackagedAppDeployment();
29+
```

docs/navigate/devops-testing/toc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,15 @@ items:
314314
- name: Crash and hang dumps
315315
href: ../../core/testing/microsoft-testing-platform-crash-hang-dumps.md
316316
displayName: MTP,crash dump,hang dump,diagnostics
317+
- name: Diagnostics
318+
href: ../../core/testing/microsoft-testing-platform-diagnostics.md
319+
displayName: MTP,diagnostics,video recorder,screen recording,capture video
320+
- name: Test host deployment
321+
href: ../../core/testing/microsoft-testing-platform-test-host-deployment.md
322+
displayName: MTP,test host,deployment,packaged app,UWP,WinUI,ITestHostLauncher
323+
- name: Microsoft.Extensions integration
324+
href: ../../core/testing/microsoft-testing-platform-extensions-integration.md
325+
displayName: MTP,Microsoft.Extensions,logging bridge,ILogger,Microsoft.Extensions.Logging
317326
- name: OpenTelemetry
318327
href: ../../core/testing/microsoft-testing-platform-open-telemetry.md
319328
displayName: MTP,OpenTelemetry,traces,metrics

0 commit comments

Comments
 (0)