From 58a2acfb32e469a98a1081bddc651a911209c168 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Tue, 23 Sep 2025 16:09:25 +0200 Subject: [PATCH 01/11] Document MTP v1 to v2 migration --- ...esting-platform-migration-from-v1-to-v2.md | 57 +++++++++++++++++++ docs/navigate/devops-testing/toc.yml | 2 + 2 files changed, 59 insertions(+) create mode 100644 docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md new file mode 100644 index 0000000000000..dc59b9eff72a0 --- /dev/null +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -0,0 +1,57 @@ +--- +title: Microsoft.Testing.Platform migration from v1 to v2 +description: Learn about migrating to Microsoft.Testing.Platform v2. +author: Youssef1313 +ms.author: ygerges +ms.date: 09/23/2025 +--- + +# Migrate from Microsoft.Testing.Platform v1 to Microsoft.Testing.Platform v2 + +The preview version Microsoft.Testing.Platform v2 is now available. This migration guide explores what's changed in Microsoft.Testing.Platform v2 and how you can migrate to this version. + +## Source breaking changes + +These are breaking changes that might cause build errors after migration. + +### Dropped unsupported target frameworks + +Support for target frameworks .NET Core 3.1 to .NET 7 is dropped. The minimum supported .NET version is .NET 8. +This change doesn't affect .NET Framework. .NET Framework 4.6.2 continues to be the minimum supported .NET Framework target. + +### Remove obsolete types + +The following types were marked obsolete in MTP v1. In MTP v2, they are now removed: + +- `ITestApplicationLifecycleCallbacks`: use `ITestHostApplicationLifetime` instead. +- `TestNodeFileArtifact`: use `FileArtifactProperty` instead. +- `KeyValuePairStringProperty`: use `TestMetadataProperty` instead. +- `TestSessionContext.Client`: use `IClientInfo` instead. + +This breaking change doesn't affect typical users of test frameworks. It only affects test framework authors and extension authors. + +### API signature changes + +- A `CancellationToken` parameter was added to `IOutputDevice.DisplayAsync`. +- Methods in `ITestSessionLifetimeHandler` interface are changed to have a `ITestSessionContext` parameter instead of both `SessionUid` and `CancellationToken` parameters. +- `IDataConsumer` is moved from `Microsoft.Testing.Platform.Extensions.TestHost` namespace to `Microsoft.Testing.Platform.Extensions`. + +This breaking change doesn't affect typical users of test frameworks. It only affects test framework authors and extension authors. + +## Behavior breaking changes + +These are breaking changes that might affect the behavior at run time. + +### Compatibility with VSTest-based `dotnet test` + +The `dotnet test` command has two implementations: + +1. VSTest-based implementation: this was the only implementation up to .NET 9 SDK. +2. MTP-based implementation: this was added starting in .NET 10 SDK. + +Running MTP test projects with .NET 10 SDK now requires opting-in to the MTP-based `dotnet test` and can no longer be run with the VSTest-based implementation, which was previously enabled by `TestingPlatformDotnetTestSupport` MSBuild property in MTP v1. + +### Rename of command-line options + +- The `--diagnostic-output-fileprefix` command-line option was renamed to `--diagnostic-file-prefix`. +- The `--diagnostic-filelogger-synchronouswrite` command-line option was renamed to `--diagnostic-synchronous-write`. \ No newline at end of file diff --git a/docs/navigate/devops-testing/toc.yml b/docs/navigate/devops-testing/toc.yml index 57a6ce1b45d6c..10cf92d8d91ce 100644 --- a/docs/navigate/devops-testing/toc.yml +++ b/docs/navigate/devops-testing/toc.yml @@ -77,6 +77,8 @@ items: href: ../../core/testing/unit-testing-mstest-migration-v3-v4.md - name: Microsoft.Testing.Platform support (MSTest runner) href: ../../core/testing/unit-testing-mstest-runner-intro.md + - name: Migrate from Microsoft.Testing.Platform v1 to Microsoft.Testing.Platform v2 + href: ../../core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md - name: Getting started items: - name: Overview From 5aaae20d114231bf8d541cc13c47e4491762fcce Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Tue, 23 Sep 2025 16:11:57 +0200 Subject: [PATCH 02/11] markdownlint --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index dc59b9eff72a0..8cb5a6212e863 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -54,4 +54,4 @@ Running MTP test projects with .NET 10 SDK now requires opting-in to the MTP-bas ### Rename of command-line options - The `--diagnostic-output-fileprefix` command-line option was renamed to `--diagnostic-file-prefix`. -- The `--diagnostic-filelogger-synchronouswrite` command-line option was renamed to `--diagnostic-synchronous-write`. \ No newline at end of file +- The `--diagnostic-filelogger-synchronouswrite` command-line option was renamed to `--diagnostic-synchronous-write`. From cd91c3e9c3624ef47a2c3dfbed222252b5725201 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 8 Oct 2025 11:58:24 +0200 Subject: [PATCH 03/11] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jakub Jareš Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 2 +- docs/navigate/devops-testing/toc.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index 8cb5a6212e863..62db087a35020 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -19,7 +19,7 @@ These are breaking changes that might cause build errors after migration. Support for target frameworks .NET Core 3.1 to .NET 7 is dropped. The minimum supported .NET version is .NET 8. This change doesn't affect .NET Framework. .NET Framework 4.6.2 continues to be the minimum supported .NET Framework target. -### Remove obsolete types +### Removed obsolete types The following types were marked obsolete in MTP v1. In MTP v2, they are now removed: diff --git a/docs/navigate/devops-testing/toc.yml b/docs/navigate/devops-testing/toc.yml index 10cf92d8d91ce..fe1ff54f3b751 100644 --- a/docs/navigate/devops-testing/toc.yml +++ b/docs/navigate/devops-testing/toc.yml @@ -77,7 +77,7 @@ items: href: ../../core/testing/unit-testing-mstest-migration-v3-v4.md - name: Microsoft.Testing.Platform support (MSTest runner) href: ../../core/testing/unit-testing-mstest-runner-intro.md - - name: Migrate from Microsoft.Testing.Platform v1 to Microsoft.Testing.Platform v2 + - name: Migrate from Microsoft.Testing.Platform v1 to v2 href: ../../core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md - name: Getting started items: From d5dcdfcf2298eb2229a80a4cba1318ff98b9f1ff Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 8 Oct 2025 11:59:50 +0200 Subject: [PATCH 04/11] Consistency --- docs/core/testing/unit-testing-mstest-migration-v3-v4.md | 2 +- docs/navigate/devops-testing/toc.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/testing/unit-testing-mstest-migration-v3-v4.md b/docs/core/testing/unit-testing-mstest-migration-v3-v4.md index 3ad4f96c01bc8..16549e8fd9e4d 100644 --- a/docs/core/testing/unit-testing-mstest-migration-v3-v4.md +++ b/docs/core/testing/unit-testing-mstest-migration-v3-v4.md @@ -6,7 +6,7 @@ ms.author: ygerges ms.date: 07/22/2025 --- -# Migrate from MSTest v3 to MSTest v4 +# Migrate from MSTest v3 to v4 The preview version MSTest v4 is now available. This migration guide explores what's changed in MSTest v4 and how you can migrate to this version. diff --git a/docs/navigate/devops-testing/toc.yml b/docs/navigate/devops-testing/toc.yml index fe1ff54f3b751..199786b0fa7a7 100644 --- a/docs/navigate/devops-testing/toc.yml +++ b/docs/navigate/devops-testing/toc.yml @@ -73,7 +73,7 @@ items: href: ../../core/testing/unit-testing-mstest-intro.md - name: Migrate MSTest from v1 to v3 href: ../../core/testing/unit-testing-mstest-migration-from-v1-to-v3.md - - name: Migrate from MSTest v3 to MSTest v4 + - name: Migrate from MSTest v3 to v4 href: ../../core/testing/unit-testing-mstest-migration-v3-v4.md - name: Microsoft.Testing.Platform support (MSTest runner) href: ../../core/testing/unit-testing-mstest-runner-intro.md From dd6a7fc31738b4cd28515590913cc7e3259f01a2 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 8 Oct 2025 12:04:28 +0200 Subject: [PATCH 05/11] xref --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index 62db087a35020..165a1be312191 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -32,7 +32,7 @@ This breaking change doesn't affect typical users of test frameworks. It only af ### API signature changes -- A `CancellationToken` parameter was added to `IOutputDevice.DisplayAsync`. +- A `CancellationToken` parameter was added to . - Methods in `ITestSessionLifetimeHandler` interface are changed to have a `ITestSessionContext` parameter instead of both `SessionUid` and `CancellationToken` parameters. - `IDataConsumer` is moved from `Microsoft.Testing.Platform.Extensions.TestHost` namespace to `Microsoft.Testing.Platform.Extensions`. From 76caf61ef6562d12df772c4b351599a7e4c193fb Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 8 Oct 2025 12:06:28 +0200 Subject: [PATCH 06/11] More xrefs --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index 165a1be312191..c11d736e39267 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -33,7 +33,7 @@ This breaking change doesn't affect typical users of test frameworks. It only af ### API signature changes - A `CancellationToken` parameter was added to . -- Methods in `ITestSessionLifetimeHandler` interface are changed to have a `ITestSessionContext` parameter instead of both `SessionUid` and `CancellationToken` parameters. +- Methods in interface are changed to have an `ITestSessionContext` parameter instead of both and parameters. - `IDataConsumer` is moved from `Microsoft.Testing.Platform.Extensions.TestHost` namespace to `Microsoft.Testing.Platform.Extensions`. This breaking change doesn't affect typical users of test frameworks. It only affects test framework authors and extension authors. From 12e524ec03883a177a6a3792f39f343576e3e28f Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 8 Oct 2025 12:11:22 +0200 Subject: [PATCH 07/11] Clarify --- ...oft-testing-platform-migration-from-v1-to-v2.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index c11d736e39267..fec177061f7b5 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -51,6 +51,20 @@ The `dotnet test` command has two implementations: Running MTP test projects with .NET 10 SDK now requires opting-in to the MTP-based `dotnet test` and can no longer be run with the VSTest-based implementation, which was previously enabled by `TestingPlatformDotnetTestSupport` MSBuild property in MTP v1. +To opt-in the MTP-based implementation, create global.json in repository or solution root (or update existing global.json if you have one already), to have test runner set as Microsoft.Testing.Platform, as shown in the following example: + +```json +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} +``` + +Attempting to run the VSTest-based `dotnet test` with MTP v2 will produce the following error: + +> Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. If you use dotnet test, you should opt-in to the new dotnet test experience. For more information, see https://aka.ms/dotnet-test-mtp-error + ### Rename of command-line options - The `--diagnostic-output-fileprefix` command-line option was renamed to `--diagnostic-file-prefix`. From a15c66595987962e9faa30f20020944948be9b98 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Wed, 8 Oct 2025 12:21:15 +0200 Subject: [PATCH 08/11] Cleanup --- ...crosoft-testing-platform-migration-from-v1-to-v2.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index fec177061f7b5..0b3550913ce0d 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -1,14 +1,14 @@ --- -title: Microsoft.Testing.Platform migration from v1 to v2 -description: Learn about migrating to Microsoft.Testing.Platform v2. +title: Migrating from Microsoft.Testing.Platform v1 to v2 +description: Learn how to migrate to Microsoft.Testing.Platform v2 and understand the key changes. author: Youssef1313 ms.author: ygerges -ms.date: 09/23/2025 +ms.date: 10/08/2025 --- -# Migrate from Microsoft.Testing.Platform v1 to Microsoft.Testing.Platform v2 +# Mirate from Microsoft.Testing.Platform v1 to v2 -The preview version Microsoft.Testing.Platform v2 is now available. This migration guide explores what's changed in Microsoft.Testing.Platform v2 and how you can migrate to this version. +The stable version Microsoft.Testing.Platform v2 is now available. This migration guide explores what's changed in Microsoft.Testing.Platform v2 and how you can migrate to this version. ## Source breaking changes From eba327fdedd515d201c368459e6259540d653fdf Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 8 Oct 2025 12:29:39 +0200 Subject: [PATCH 09/11] Fix markdownlint --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index 0b3550913ce0d..44d6e89b1458b 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -63,7 +63,7 @@ To opt-in the MTP-based implementation, create global.json in repository or solu Attempting to run the VSTest-based `dotnet test` with MTP v2 will produce the following error: -> Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. If you use dotnet test, you should opt-in to the new dotnet test experience. For more information, see https://aka.ms/dotnet-test-mtp-error +> Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. If you use dotnet test, you should opt-in to the new dotnet test experience. For more information, see ### Rename of command-line options From f31b7046408795632a710cee2e5dadf1dd132959 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 8 Oct 2025 12:56:56 +0200 Subject: [PATCH 10/11] Update docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jakub Jareš --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index 44d6e89b1458b..90e8b11fed5af 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -16,7 +16,7 @@ These are breaking changes that might cause build errors after migration. ### Dropped unsupported target frameworks -Support for target frameworks .NET Core 3.1 to .NET 7 is dropped. The minimum supported .NET version is .NET 8. +Support for target frameworks from .NET Core 3.1 to .NET 7 is dropped. The minimum supported .NET version is .NET 8. This change doesn't affect .NET Framework. .NET Framework 4.6.2 continues to be the minimum supported .NET Framework target. ### Removed obsolete types From 0c04fd4a4ccf5fa7714d102c3fc89f8f9fafced0 Mon Sep 17 00:00:00 2001 From: Youssef Victor Date: Wed, 8 Oct 2025 21:15:34 +0200 Subject: [PATCH 11/11] Apply suggestions from code review Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --- .../microsoft-testing-platform-migration-from-v1-to-v2.md | 6 +++--- docs/navigate/devops-testing/toc.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md index 90e8b11fed5af..5d300df35e400 100644 --- a/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md +++ b/docs/core/testing/microsoft-testing-platform-migration-from-v1-to-v2.md @@ -21,7 +21,7 @@ This change doesn't affect .NET Framework. .NET Framework 4.6.2 continues to be ### Removed obsolete types -The following types were marked obsolete in MTP v1. In MTP v2, they are now removed: +The following types were marked obsolete in MTP v1. In MTP v2, they are removed completely: - `ITestApplicationLifecycleCallbacks`: use `ITestHostApplicationLifetime` instead. - `TestNodeFileArtifact`: use `FileArtifactProperty` instead. @@ -46,8 +46,8 @@ These are breaking changes that might affect the behavior at run time. The `dotnet test` command has two implementations: -1. VSTest-based implementation: this was the only implementation up to .NET 9 SDK. -2. MTP-based implementation: this was added starting in .NET 10 SDK. +- VSTest-based implementation: this was the only implementation up to .NET 9 SDK. +- MTP-based implementation: this was added starting in .NET 10 SDK. Running MTP test projects with .NET 10 SDK now requires opting-in to the MTP-based `dotnet test` and can no longer be run with the VSTest-based implementation, which was previously enabled by `TestingPlatformDotnetTestSupport` MSBuild property in MTP v1. diff --git a/docs/navigate/devops-testing/toc.yml b/docs/navigate/devops-testing/toc.yml index 199786b0fa7a7..a5dcb8eb0fc37 100644 --- a/docs/navigate/devops-testing/toc.yml +++ b/docs/navigate/devops-testing/toc.yml @@ -71,7 +71,7 @@ items: items: - name: Overview href: ../../core/testing/unit-testing-mstest-intro.md - - name: Migrate MSTest from v1 to v3 + - name: Migrate from MSTest v1 to v3 href: ../../core/testing/unit-testing-mstest-migration-from-v1-to-v3.md - name: Migrate from MSTest v3 to v4 href: ../../core/testing/unit-testing-mstest-migration-v3-v4.md