diff --git a/docs/core/testing/microsoft-testing-platform-cli-options.md b/docs/core/testing/microsoft-testing-platform-cli-options.md index 5d018601b41c4..6d01498c010e6 100644 --- a/docs/core/testing/microsoft-testing-platform-cli-options.md +++ b/docs/core/testing/microsoft-testing-platform-cli-options.md @@ -3,7 +3,7 @@ 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: 06/16/2026 +ms.date: 07/09/2026 ai-usage: ai-assisted --- @@ -95,7 +95,7 @@ This article gives a central entry point for MTP command-line options. Filters the tests to run by their test node UIDs. Accepts one or more UIDs. > [!NOTE] - > This option is available in MTP starting with version 1.8.0. + > This option is available in MTP starting with version 1.8.0. Starting with MTP 2.3.0, you can't combine `--filter-uid` with `--treenode-filter`; specifying both fails command-line validation with the `InvalidCommandLine` exit code. - **`--help`** @@ -150,6 +150,9 @@ This article gives a central entry point for MTP command-line options. Filters the tests to run by using a tree filter expression. Tree filters offer richer matching than `--filter` for advanced scenarios. + > [!NOTE] + > Starting with MTP 2.3.0, you can't combine `--treenode-filter` with `--filter-uid`; specifying both fails command-line validation with the `InvalidCommandLine` exit code. + - **`--zero-tests-policy`** Controls whether a run that executes no tests because every test was skipped is treated as a failure. Valid values are `allow-skipped` (default) and `strict`. With `allow-skipped`, an all-skipped run succeeds; with `strict`, it fails with exit code 8 (the behavior before 2.3.0). diff --git a/docs/core/testing/order-unit-tests.md b/docs/core/testing/order-unit-tests.md index f3a0ce4a372b6..007e95a18c0c7 100644 --- a/docs/core/testing/order-unit-tests.md +++ b/docs/core/testing/order-unit-tests.md @@ -1,7 +1,7 @@ --- title: Order unit tests description: Learn how to order unit tests with .NET Core. -ms.date: 02/20/2026 +ms.date: 07/08/2026 ai-usage: ai-assisted zone_pivot_groups: unit-testing-framework-set-one --- @@ -49,6 +49,23 @@ Starting with MSTest 3.6, a new runsettings option lets you run tests by test na ``` +## Order randomly + +In MSTest 4.3 and later, run tests in a random order to surface hidden ordering dependencies between tests. To enable random order, set the `RandomizeTestOrder` setting to **true** in your runsettings file: + +```xml + + + + + true + + + +``` + +To make the random order reproducible, set the `RandomTestOrderSeed` setting to an integer seed. MSTest then replays the same order on every run. When you leave the seed unset, MSTest generates a new seed for each run. Don't combine `RandomizeTestOrder` with `OrderTestsByNameInClass`, because MSTest applies only one ordering mode at a time. For more information, see [Configure MSTest](unit-testing-mstest-configure.md). + :::zone-end :::zone pivot="xunit"