From 0e0bee79382a16f6b0caf02cdf52d80d3b612df5 Mon Sep 17 00:00:00 2001 From: Azat Mukhametshin Date: Tue, 14 Jul 2026 17:20:11 +0200 Subject: [PATCH] Sync dotnet test (VSTest) docs with microsoft/vstest repo Cross-referenced docs/core/tools/dotnet-test-vstest.md against the microsoft/vstest /docs directory and fixed outdated/incomplete content: - Corrected the --filter property table (filter.md): xUnit uses Traits (not Category); NUnit adds TestCategory and Property; added a note on how traits/properties/categories map to filters. - Documented the --diag tracelevel sub-option and its allowed values (diagnose.md). - Documented TestRunParameters command-line support (since .NET 5 SDK) and RunSettings precedence (RunSettingsArguments.md). - Updated the RunSettingsArguments link from the archived Microsoft/vstest-docs repo to microsoft/vstest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5857e78c-41dd-4f82-a41b-cbf1fe5f35cb --- docs/core/tools/dotnet-test-vstest.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/core/tools/dotnet-test-vstest.md b/docs/core/tools/dotnet-test-vstest.md index 765199dddae39..42a424d5545f2 100644 --- a/docs/core/tools/dotnet-test-vstest.md +++ b/docs/core/tools/dotnet-test-vstest.md @@ -1,7 +1,7 @@ --- title: dotnet test command with VSTest description: The dotnet test command is used to execute unit tests in a given project using VSTest. -ms.date: 12/29/2024 +ms.date: 07/14/2026 ai-usage: ai-assisted --- # dotnet test with VSTest @@ -160,6 +160,8 @@ Where `Microsoft.NET.Test.Sdk` is the test host, `xunit` is the test framework. Enables diagnostic mode for the test platform and writes diagnostic messages to the specified file and to files next to it. The process that is logging the messages determines which files are created, such as `*.host_.txt` for test host log, and `*.datacollector_.txt` for data collector log. + To set the trace level, append `;tracelevel=` to the log file name, for example `--diag:log.txt;tracelevel=verbose`. The allowed values for `tracelevel` are `off`, `error`, `warning`, `info`, and `verbose`. The default value is `verbose`. + - [!INCLUDE [disable-build-servers](includes/cli-disable-build-servers.md)] - **`-e|--environment `** @@ -254,7 +256,9 @@ Where `Microsoft.NET.Test.Sdk` is the test host, `xunit` is the test framework. Example: `dotnet test -- MSTest.DeploymentEnabled=false MSTest.MapInconclusiveToFailed=True` - For more information, see [Passing RunSettings arguments through command line](https://github.com/Microsoft/vstest-docs/blob/main/docs/RunSettingsArguments.md). + Starting with the .NET 5 SDK, you can also set `TestRunParameters` from the command line, for example: `dotnet test -- TestRunParameters.Parameter(name=\"myParam\", value=\"value\")`. `RunSettings` arguments take precedence over values from a `.runsettings` file. + + For more information, see [Passing RunSettings arguments through command line](https://github.com/microsoft/vstest/blob/main/docs/RunSettingsArguments.md). ## Examples @@ -357,8 +361,10 @@ Where `Microsoft.NET.Test.Sdk` is the test host, `xunit` is the test framework. | Test Framework | Supported properties | | -------------- | --------------------------------------------------------------------------------------------------------- | | MSTest |
  • FullyQualifiedName
  • Name
  • ClassName
  • Priority
  • TestCategory
| -| xUnit |
  • FullyQualifiedName
  • DisplayName
  • Category
| -| NUnit |
  • FullyQualifiedName
  • Name
  • Category
  • Priority
| +| xUnit |
  • FullyQualifiedName
  • DisplayName
  • Traits
| +| NUnit |
  • FullyQualifiedName
  • Name
  • Priority
  • TestCategory
  • Category
  • Property
| + +For xUnit, a trait defined with `[Trait("key", "value")]` is filtered by its key (for example, `[Trait("Category", "bvt")]` is matched with `--filter Category=bvt`). For NUnit, `TestCategory` and `Category` are equivalent, and a property defined with `[Property("key", "value")]` is filtered by its key. The `` describes the relationship between the property and the value: