Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion docs/core/testing/microsoft-testing-platform-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Microsoft.Testing.Platform (MTP) AI integrations
description: Learn how MTP extensions access AI chat clients and configure the Azure AI Foundry provider.
author: Evangelink
ms.author: amauryleve
ms.date: 08/26/2026
ms.date: 08/28/2026
ai-usage: ai-assisted
---

Expand All @@ -14,6 +14,22 @@ The experimental [Microsoft.Testing.Platform.AI](https://www.nuget.org/packages/
> [!IMPORTANT]
> The AI APIs use the `TPEXP` diagnostic ID and can change in a future release. The packages supply infrastructure to extensions; they don't add AI behavior to a test suite by themselves.

## Use AI coding tools for test workflows

The packages in this article let MTP extensions call AI models during a test run. To use an AI coding assistant to create, analyze, or migrate tests in your repository, use the curated [.NET Agent Skills](https://github.com/dotnet/skills) instead.

Choose a workflow based on your goal:

| Goal | Skill or agent |
|---|---|
| Create or extend tests | Use the [`code-testing-agent` skill](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/code-testing-agent) from the [`dotnet-test` plugin](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test). The skill researches the codebase, plans the work, implements tests, and verifies the changes. |
| Run or troubleshoot tests | Use the [`run-tests` skill](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/run-tests) to execute tests or diagnose test execution without changing test code. |
| Audit test quality | Use the [`test-quality-auditor` agent](https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/agents/test-quality-auditor.agent.md) for a broad assessment, or invoke a focused skill from the [`dotnet-test` skills directory](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills) for assertions, coverage, test gaps, or test smells. |
| Improve testability | Use the [`testability-migration` agent](https://github.com/dotnet/skills/blob/main/plugins/dotnet-test/agents/testability-migration.agent.md) to find static dependencies and introduce testable abstractions. |
| Migrate a test framework or platform | Use the [`test-migration` agent](https://github.com/dotnet/skills/blob/main/plugins/dotnet-test-migration/agents/test-migration.agent.md) from the [`dotnet-test-migration` plugin](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test-migration). The agent detects the current setup and selects the appropriate migration skill. |

For installation steps and supported coding agents, see the [.NET Agent Skills repository](https://github.com/dotnet/skills#installation). Install `dotnet-test` alongside `dotnet-test-migration` because migration workflows reuse its platform detection and test verification skills.

## Choose the packages

Add the abstractions package when you author an extension that consumes a chat client. Add a provider package to the test application that hosts the extension:
Expand Down
26 changes: 13 additions & 13 deletions docs/core/testing/microsoft-testing-platform-cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ title: Microsoft.Testing.Platform (MTP) CLI options reference
description: Find platform and extension command-line options for MTP in one place.
author: Evangelink
ms.author: amauryleve
ms.date: 08/26/2026
ms.date: 08/31/2026
ai-usage: ai-assisted
---

# Microsoft.Testing.Platform (MTP) CLI options reference

This article gives a central entry point for MTP command-line options.

> [!IMPORTANT]
> Platform options are available from MTP itself. Extension options are available only when each targeted test application registers the extension package that provides them. Add the package directly, or use a test SDK configuration or profile that includes it. If a test application doesn't register the extension, the run fails with exit code 5 because the option is unrecognized.

## Platform options

- **`@`**
Expand Down Expand Up @@ -183,22 +186,19 @@ This article gives a central entry point for MTP command-line options.

## Extension options by scenario

Use the following table to find extension options quickly.
Use the following table to find each extension's package and options. A test SDK profile can supply a package instead of a direct package reference.

| Scenario | Feature documentation |
|---|---|
| Collect code coverage | [Code coverage](./microsoft-testing-platform-code-coverage.md) |
| Collect crash or hang dumps | [Crash and hang dumps](./microsoft-testing-platform-crash-hang-dumps.md) |
| Generate test reports (for example TRX) | [Test reports](./microsoft-testing-platform-test-reports.md) |
| Customize terminal output | [Terminal output](./microsoft-testing-platform-terminal-output.md) |
| Apply hosting-level controls | [Hot Reload](./microsoft-testing-platform-hot-reload.md) |
| Retry failed tests | [Retry](./microsoft-testing-platform-retry.md#retry) |
| Run tests that use Microsoft Fakes | [Microsoft Fakes](./microsoft-testing-platform-fakes.md) |
| Emit OpenTelemetry traces and metrics | [OpenTelemetry](./microsoft-testing-platform-open-telemetry.md) |
| Scenario | Required component | Feature documentation |
|---|---|---|
| Collect code coverage | `Microsoft.Testing.Extensions.CodeCoverage` or `coverlet.MTP` | [Code coverage](./microsoft-testing-platform-code-coverage.md) |
| Collect crash or hang dumps | `Microsoft.Testing.Extensions.CrashDump` or `Microsoft.Testing.Extensions.HangDump` | [Crash and hang dumps](./microsoft-testing-platform-crash-hang-dumps.md) |
| Generate test reports | The extension package for the selected format, such as `Microsoft.Testing.Extensions.TrxReport` | [Test reports](./microsoft-testing-platform-test-reports.md) |
| Customize terminal output | MTP core (no additional package) | [Terminal output](./microsoft-testing-platform-terminal-output.md) |
| Retry failed tests | `Microsoft.Testing.Extensions.Retry` | [Retry](./microsoft-testing-platform-retry.md#retry) |

## Discover options in your test app

Run your test executable with `--help` to list the options available for your current extension set.
Run your test executable with `--help`, or run `dotnet test --help` in MTP mode, to list the options available for your current extension set.

For advanced diagnostics of registered providers and options, run with `--info`.

Expand Down
10 changes: 6 additions & 4 deletions docs/core/testing/microsoft-testing-platform-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Microsoft.Testing.Platform (MTP) config options
description: Learn how to configure MTP using testconfig.json configuration settings and environment variables.
author: Evangelink
ms.author: amauryleve
ms.date: 08/26/2026
ms.date: 08/31/2026
ai-usage: ai-assisted
---

Expand Down Expand Up @@ -100,6 +100,8 @@ Before MTP 2.3.0, extension features such as [crash dump](microsoft-testing-plat

Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json* through `IConfiguration`. This support includes extension options, so you can use JSON entries for options that you don't want to pass on the command line each run. Command-line arguments still take precedence.

Configuration doesn't install or register an extension. Each test application must reference the package that provides an extension option, either directly or through a test SDK configuration or profile. Otherwise, the option remains unrecognized whether you put it in *testconfig.json* or on the command line.

For a complete reference of command-line options, see [MTP CLI options reference](microsoft-testing-platform-cli-options.md).

### Test framework-specific settings
Expand Down Expand Up @@ -146,9 +148,9 @@ If you're migrating from a *.runsettings* file, the following table maps common
| `RunConfiguration/MaxCpuCount` | No equivalent | Process-level parallelism is controlled by `dotnet test --max-parallel-test-modules` or MSBuild `/m` option. |
| `MSTest/*` | `mstest.*` | See [Configure MSTest — testconfig.json](unit-testing-mstest-configure.md#testconfigjson). |
| `xUnit/*` | `xUnit.*` | See [xUnit.net testconfig.json](https://xunit.net/docs/config-testconfig-json). |
| `LoggerRunSettings/Loggers` | CLI options | Use `--report-trx` or similar CLI options. Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json*. |
| `DataCollectionRunSettings` (blame) | CLI options | Use `--crashdump` and `--hangdump` CLI options. Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json*. See [Crash and hang dumps](microsoft-testing-platform-crash-hang-dumps.md). |
| `DataCollectionRunSettings` (coverage) | CLI options | Use `--coverage` CLI option. Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json*. See [Code coverage](microsoft-testing-platform-code-coverage.md). |
| `LoggerRunSettings/Loggers` | CLI options | Use the option from the installed report extension. For example, `--report-trx` requires `Microsoft.Testing.Extensions.TrxReport`. Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json*. See [Test reports](microsoft-testing-platform-test-reports.md). |
| `DataCollectionRunSettings` (blame) | CLI options | Use `--crashdump` from `Microsoft.Testing.Extensions.CrashDump` or `--hangdump` from `Microsoft.Testing.Extensions.HangDump`. Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json*. See [Crash and hang dumps](microsoft-testing-platform-crash-hang-dumps.md). |
| `DataCollectionRunSettings` (coverage) | CLI options | Use `--coverage` from `Microsoft.Testing.Extensions.CodeCoverage`. Starting with MTP 2.3.0, MTP can read CLI options from *testconfig.json*. See [Code coverage](microsoft-testing-platform-code-coverage.md). |
| `TestRunParameters` | `--test-parameter` CLI | Use `--test-parameter key=value` on the command line. |

## Environment variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Microsoft.Testing.Platform (MTP) Hot Reload
description: Learn about the MTP Hot Reload extension for running tests with hot reload.
author: evangelink
ms.author: amauryleve
ms.date: 02/25/2026
ms.date: 08/28/2026
ai-usage: ai-assisted
---

Expand All @@ -25,6 +25,8 @@ builder.TestHost.AddHotReloadProvider();

Hot reload lets you modify your app's managed source code while the application is running, without the need to manually pause or hit a breakpoint. Simply make a supported change while the app is running and select the **Apply code changes** button in Visual Studio to apply your edits.

If you use an AI coding assistant, the [`mtp-hot-reload` .NET Agent Skill](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test/skills/mtp-hot-reload) guides the assistant through setup and recovery from unsupported edits. This skill isn't an MTP extension or CLI plugin.

> [!NOTE]
> The current version is limited to supporting hot reload in "console mode" only. There is currently no support for hot reload in Test Explorer for Visual Studio or Visual Studio Code.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ title: Microsoft.Testing.Platform (MTP) test reports
description: Learn about the MTP extensions that create test report files (TRX, HTML, JUnit, CTRF, Azure DevOps, GitHub Actions).
author: evangelink
ms.author: amauryleve
ms.date: 08/26/2026
ms.date: 08/31/2026
ai-usage: ai-assisted
---

# Test reports

These features require installing additional NuGet packages, as described in each section.
Each report option requires the extension package named in its section. Add the package directly, or use a test SDK configuration or profile that includes it. Report extensions aren't part of MTP core, so an option such as `--report-trx` is unrecognized when the test application doesn't register its extension. Run the test application with `--help`, or run `dotnet test --help` in MTP mode, to confirm that an option is available.

> [!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>`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Microsoft.Testing.Platform (MTP) troubleshooting
description: Troubleshoot MTP issues, exit codes, and known problems.
author: Evangelink
ms.author: amauryleve
ms.date: 06/01/2026
ms.date: 08/31/2026
ai-usage: ai-assisted
---

Expand Down Expand Up @@ -111,8 +111,12 @@ This error can occur if not all of the Fakes assemblies are present in the bin f
- Ensure that the project either uses the [MSTest.SDK](./unit-testing-mstest-sdk.md) or references [Microsoft.Testing.Extensions.Fakes](./microsoft-testing-platform-fakes.md).
- For .NET Framework projects, avoid setting `<PlatformTarget>AnyCPU</PlatformTarget>` as this results in NuGet not copying all files to the bin folder.

### Unrecognized command-line option in solutions with mixed test frameworks or extensions
### Unrecognized extension command-line option

If your solution contains projects that use different test frameworks (for example, MSTest and xUnit.net) or different sets of extensions (for example, only some projects reference `Microsoft.Testing.Extensions.HangDump`), running `dotnet test` with a framework-specific or extension-specific command-line option can fail with exit code 5. The option is valid for one project but unrecognized by another.
An extension-specific command-line option can fail with exit code 5 when a test application doesn't register the package that provides the option. For example, `--report-trx` requires `Microsoft.Testing.Extensions.TrxReport`, either as a direct package reference or through a test SDK configuration or profile that includes the package. MTP core doesn't include report, code coverage, dump, retry, or other extension options.

Run the test application with `--help`, or run `dotnet test --help` in MTP mode, to confirm that the option is available. If the option is missing, add its extension package or enable the extension through your test SDK. See [Extension options by scenario](microsoft-testing-platform-cli-options.md#extension-options-by-scenario) to find the required package.

The same failure occurs when a solution contains projects that use different test frameworks (for example, MSTest and xUnit.net) or different sets of extensions (for example, only some projects reference `Microsoft.Testing.Extensions.HangDump`). The option is valid for one project but unrecognized by another.

To resolve this issue, use the `TestingPlatformCommandLineArguments` MSBuild property with conditions to route arguments to the correct projects. For detailed instructions, see [Solutions with mixed test frameworks or extensions](unit-testing-with-dotnet-test.md#solutions-with-mixed-test-frameworks-or-extensions).
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Migration guide from VSTest to Microsoft.Testing.Platform (MTP)
description: Step-by-step guide to migrate from VSTest to Microsoft.Testing.Platform (MTP), including argument mapping, project configuration, and CI pipeline updates.
author: Youssef1313
ms.author: ygerges
ms.date: 08/26/2026
ms.date: 08/31/2026
ai-usage: ai-assisted
---

Expand All @@ -19,6 +19,9 @@ If you need detailed behavior of `dotnet test` modes, see [Testing with `dotnet

If you need a single list of platform and extension command-line options, see [MTP CLI options reference](./microsoft-testing-platform-cli-options.md).

> [!TIP]
> To automate a repository-wide migration with an AI coding assistant, install the [`dotnet-test`](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test) and [`dotnet-test-migration`](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test-migration) plugins from [.NET Agent Skills](https://github.com/dotnet/skills). Ask the [`test-migration` agent](https://github.com/dotnet/skills/blob/main/plugins/dotnet-test-migration/agents/test-migration.agent.md) to detect and migrate your test setup, or invoke the [`migrate-vstest-to-mtp` skill](https://github.com/dotnet/skills/tree/main/plugins/dotnet-test-migration/skills/migrate-vstest-to-mtp) for this specific migration. Review the generated changes before you merge them.

## Opt-in to use MTP

The first step in the migration is to opt-in to using MTP.
Expand Down Expand Up @@ -68,7 +71,7 @@ Starting with .NET 10 SDK, there is *native* support for MTP. To use it, you mus
```

> [!IMPORTANT]
> In this mode, the extra `--` is no longer used.
> In this mode, the extra `--` is no longer required. Keep it to forward test application arguments unambiguously.

### Update `dotnet test` invocations

Expand Down Expand Up @@ -175,6 +178,9 @@ With MTP, this becomes:
dotnet test --coverage --coverage-output-format cobertura
```

> [!IMPORTANT]
> To use `--coverage`, each targeted test application must reference the `Microsoft.Testing.Extensions.CodeCoverage` NuGet package directly or through a test SDK configuration or profile that includes it.
>
> [!IMPORTANT]
> As explained earlier, when using MTP with the VSTest-based `dotnet test`, extra `--` is needed before the arguments intended to be passed to the platform.
> So, this becomes `dotnet test -- --coverage --coverage-output-format cobertura`.
Expand Down Expand Up @@ -223,7 +229,7 @@ dotnet test --report-trx
```

> [!IMPORTANT]
> To use `--report-trx`, you must have the `Microsoft.Testing.Extensions.TrxReport` NuGet package installed.
> To use `--report-trx`, each targeted test application must reference the `Microsoft.Testing.Extensions.TrxReport` NuGet package directly or through a test SDK configuration or profile that includes it.
>
> [!IMPORTANT]
> As explained earlier, when using MTP with the VSTest-based `dotnet test`, extra `--` is needed before the arguments intended to be passed to the platform.
Expand Down Expand Up @@ -291,6 +297,8 @@ If you're using the [VSTest task](/azure/devops/pipelines/tasks/reference/vstest
arguments: '-- --report-trx --results-directory $(Agent.TempDirectory)'
```

The test applications in this example must register `Microsoft.Testing.Extensions.TrxReport`. Add the package directly, or use a test SDK configuration or profile that includes it.

## Behavioral differences between VSTest and MTP

### Running zero tests
Expand Down
4 changes: 3 additions & 1 deletion docs/core/testing/unit-testing-mstest-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: MSTest SDK configuration
author: MarcoRossignoli
description: Learn how to configure MSTest.Sdk profiles, extensions, and advanced features.
ms.author: mrossignoli
ms.date: 08/27/2026
ms.date: 08/31/2026
ai-usage: ai-assisted
---

Expand Down Expand Up @@ -239,6 +239,8 @@ Once you've updated your projects, if you're using MTP (default) and if you rely

If you're using the VSTest mode of `dotnet test`, here's an example update when using the `DotNetCoreCLI` task in Azure DevOps:

The default MSTest.Sdk extension profile supplies the `Microsoft.Testing.Extensions.TrxReport` and `Microsoft.Testing.Extensions.CodeCoverage` packages required by the added options. If you select the `None` profile, enable or reference both extensions before you use the options.

```diff
\- task: DotNetCoreCLI@2
inputs:
Expand Down
Loading
Loading