You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/testing/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The test platform is the engine that runs the tests and acts as a communication
43
43
44
44
VSTest has been used for many years in .NET and was the only test platform in the ecosystem. Early in 2024, the first stable version of a new test platform, called [Microsoft.Testing.Platform (MTP)](./microsoft-testing-platform-intro.md), was released. For more information about migrating from VSTest to Microsoft.Testing.Platform, see [Migration guide from VSTest to Microsoft.Testing.Platform](./migrating-vstest-microsoft-testing-platform.md).
45
45
46
-
The test platform also provides extensibility APIs so that additional features can be implemented and get them working for all test frameworks. There are usually built-in features built on top of the extensibility APIs, such as TRX reporting and hang and crash dumps. The community can also build their own extensions that end up working for all test frameworks.
46
+
The test platform also provides extensibility APIs so that additional features can be implemented and made available for all test frameworks. There are usually built-in features built on top of the extensibility APIs, such as TRX reporting and hang and crash dumps. The community can also build custom extensions that work for all test frameworks.
Copy file name to clipboardExpand all lines: docs/core/testing/migrating-vstest-microsoft-testing-platform.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ ms.author: ygerges
6
6
ms.date: 09/15/2025
7
7
---
8
8
9
-
# Migration guide from VSTest to Microsoft.Testing.Platform
9
+
# Migrate from VSTest to Microsoft.Testing.Platform
10
10
11
-
In this article, you'll learn how to migrate from VSTest to Microsoft.Testing.Platform.
11
+
In this article, you learn how to migrate from VSTest to Microsoft.Testing.Platform.
12
12
13
13
## Opt-in to use Microsoft.Testing.Platform
14
14
@@ -41,7 +41,7 @@ To opt-in, add `<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlat
41
41
42
42
### Opt-in for .NET 9 SDK and earlier
43
43
44
-
In .NET 9 SDK and earlier, there is no *native* support for Microsoft.Testing.Platform for `dotnet test`. However, we provide support that is built on top of VSTest infrastructure. To use that, add `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` under a `PropertyGroup` in [`Directory.Build.props`](/visualstudio/msbuild/customize-by-directory) file.
44
+
In .NET 9 SDK and earlier, there is no *native* support for Microsoft.Testing.Platform for `dotnet test`. Support is built on top of the VSTest infrastructure. To use that, add `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` under a `PropertyGroup` in [`Directory.Build.props`](/visualstudio/msbuild/customize-by-directory) file.
45
45
46
46
> [!IMPORTANT]
47
47
> When running Microsoft.Testing.Platform support in this mode, you need to add `--` to separate the `dotnet test` arguments from the new platform arguments. For example, `dotnet test --no-build -- --list-tests`.
@@ -63,9 +63,9 @@ Starting with .NET 10 SDK, there is *native* support for Microsoft.Testing.Platf
63
63
64
64
### Update `dotnet test` invocations
65
65
66
-
Command line options of `dotnet test` are divided into 2 categories: buildrelated arguments and testrelated ones.
66
+
Command line options of `dotnet test` are divided into two categories: build-related arguments and test-related ones.
67
67
68
-
The buildrelated arguments are irrelevant to the test platform and as such don't need to be updated for the new platform. Buildrelated arguments are listed below:
68
+
The build-related arguments are irrelevant to the test platform and as such don't need to be updated for the new platform. Build-related arguments are listed here:
69
69
70
70
-`-a|--arch <ARCHITECTURE>`
71
71
-`--artifacts-path <ARTIFACTS_DIR>`
@@ -81,7 +81,7 @@ The build related arguments are irrelevant to the test platform and as such don'
81
81
-`-r|--runtime <RUNTIME_IDENTIFIER>`
82
82
-`-v|--verbosity <LEVEL>`
83
83
84
-
The testrelated arguments are VSTest specific and so need to be transformed to match the new platform. The following table shows the mapping between the VSTest arguments and the new platform:
84
+
The test-related arguments are VSTest specific and so need to be transformed to match the new platform. The following table shows the mapping between the VSTest arguments and the new platform:
85
85
86
86
| VSTest argument | New platform argument |
87
87
|-----------------|-----------------------|
@@ -104,7 +104,7 @@ The test related arguments are VSTest specific and so need to be transformed to
104
104
105
105
#### `--collect`
106
106
107
-
`--collect` is a general extensibility point in VSTest for any data collector. The extensibility model of Microsoft.Testing.Platform is different and there is no such centralized argument to be used by all data collectors. With Microsoft.Testing.Platform, each data collector can add its own command-line option. For example, running Microsoft CodeCoverage through VSTest can be similar to the following:
107
+
`--collect` is a general extensibility point in VSTest for any data collector. The extensibility model of Microsoft.Testing.Platform is different and there is no such centralized argument to be used by all data collectors. With Microsoft.Testing.Platform, each data collector can add its own command-line option. For example, running Microsoft CodeCoverage through VSTest might be similar to the following:
108
108
109
109
```dotnetcli
110
110
dotnet test --collect "Code Coverage;Format=cobertura"
@@ -122,7 +122,7 @@ dotnet test --coverage --coverage-output-format cobertura
122
122
123
123
#### `--filter`
124
124
125
-
`--filter` is the VSTest-based filter. This is supported by MSTest and NUnit even when running with Microsoft.Testing.Platform. However, for xUnit.net, this is no longer supported when running with Microsoft.Testing.Platform. You must migrate from the VSTest-based filter to the new filter support in xunit.v3 which is provided using the following command-line options:
125
+
`--filter` is the VSTest-based filter. This is supported by MSTest and NUnit even when running with Microsoft.Testing.Platform. However, for xUnit.net, this is no longer supported when running with Microsoft.Testing.Platform. You must migrate from the VSTest-based filter to the new filter support in xunit.v3, which is provided using the following command-line options:
126
126
127
127
-`--filter-class`
128
128
-`--filter-not-class`
@@ -140,22 +140,22 @@ For more information, see [Microsoft.Testing.Platform documentation for xUnit.ne
140
140
141
141
What was usually referred to as "logger" in VSTest is referred to as "reporter" in Microsoft.Testing.Platform. In Microsoft.Testing.Platform, logging is explicitly for diagnosing purposes only.
142
142
143
-
Similar to `--collect`, `--logger` is a general extensibility point in VSTest for any logger (what we call reporter in the context of Microsoft.Testing.Platform). Each Microsoft.Testing.Platform reporter is free to add its own command-line option, and as such there is no centralized command-line option similar to VSTest's `--logger`.
143
+
Similar to `--collect`, `--logger` is a general extensibility point in VSTest for any logger (or, in the context of Microsoft.Testing.Platform, any *reporter*). Each Microsoft.Testing.Platform reporter is free to add its own command-line option, and as such there is no centralized command-line option like VSTest's `--logger`.
144
144
145
-
One of the very commonly used VSTest loggers is the TRX logger. This was usually called as follows:
145
+
One of the very commonly used VSTest loggers is the TRX logger. This logger is usually called as follows:
146
146
147
147
```dotnetcli
148
148
dotnet test --logger trx
149
149
```
150
150
151
-
With Microsoft.Testing.Platform, this becomes:
151
+
With Microsoft.Testing.Platform, the command becomes:
152
152
153
153
```dotnetcli
154
154
dotnet test --report-trx
155
155
```
156
156
157
157
> [!IMPORTANT]
158
-
> In order to use `--report-trx`, you must have `Microsoft.Testing.Extensions.TrxReport` NuGet package.
158
+
> To use `--report-trx`, you must have the `Microsoft.Testing.Extensions.TrxReport` NuGet package installed.
159
159
>
160
160
> [!IMPORTANT]
161
161
> As explained earlier, when using Microsoft.Testing.Platform with the VSTest-based `dotnet test`, extra `--` is needed before the arguments intended to be passed to the platform.
@@ -191,8 +191,8 @@ If you're using the [VSTest task](/azure/devops/pipelines/tasks/reference/vstest
191
191
192
192
### .NET Core CLI task
193
193
194
-
1. If you have custom `arguments` passed to the task, this needs to follow the same guidance as the `dotnet test` migration guidance.
195
-
1. If you're using the [DotNetCoreCLI](/azure/devops/pipelines/tasks/reference/dotnet-core-cli-v2) task without opting-in the native Microsoft.Testing.Platform experience for .NET 10 SDK and later via `global.json` file, you need to set the task `arguments` to correctly point to the results directory it used to point to, as well as requested TRX report. For example:
194
+
- If you have custom `arguments` passed to the task, follow the same guidance for `dotnet test` migration.
195
+
- If you're using the [DotNetCoreCLI](/azure/devops/pipelines/tasks/reference/dotnet-core-cli-v2) task without opting-in to the native Microsoft.Testing.Platform experience for .NET 10 SDK and later via `global.json` file, you need to set the task `arguments` to correctly point to the results directory it used to point to, as well as the requested TRX report. For example:
0 commit comments