Document MSTest 4.3 random test order and parallelization MSBuild properties#54480
Open
Evangelink wants to merge 4 commits into
Open
Document MSTest 4.3 random test order and parallelization MSBuild properties#54480Evangelink wants to merge 4 commits into
Evangelink wants to merge 4 commits into
Conversation
…Build properties Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates MSTest documentation to cover newly available MSTest 4.3 configuration features for random test order and assembly-level parallelization, including how to configure them via runsettings, testconfig.json, and MSBuild properties.
Changes:
- Documented
RandomizeTestOrderandRandomTestOrderSeedfor runsettings andtestconfig.json. - Added an MSBuild properties section documenting
MSTestParallelizeScopeandMSTestParallelizeWorkers. - Updated the parallelization tip to cross-reference the new MSBuild properties section.
Show a summary per file
| File | Description |
|---|---|
| docs/core/testing/unit-testing-mstest-writing-tests-controlling-execution.md | Adds ai-usage metadata and cross-references the new MSBuild parallelization properties in the parallelization tip. |
| docs/core/testing/unit-testing-mstest-configure.md | Adds ai-usage metadata, documents MSTest 4.3 random-order settings, and adds an MSBuild properties section for assembly-level parallelization configuration. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 5
…s, real attribute syntax in example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
gewarren
approved these changes
Jun 22, 2026
| |**MapNotRunnableToFailed**|true|A value indicating whether a not runnable result is mapped to failed test.| | ||
| |**OrderTestsByNameInClass**|false|If you want to run tests by test names both in Test Explorers and on the command line, set this value to **true**.| | ||
| |**Parallelize**||Used to set the parallelization settings:<br /><br />**Workers**: The number of threads/workers to be used for parallelization, which is by default **the number of processors on the current machine**.<br /><br />**SCOPE**: The scope of parallelization. You can set it to **MethodLevel**. By default, it's **ClassLevel**.<br /><br />`<Parallelize><Workers>32</Workers><Scope>MethodLevel</Scope></Parallelize>`| | ||
| |**RandomizeTestOrder**|false|Starting with MSTest 4.3, set this value to **true** to run tests in a random order, which helps surface hidden ordering dependencies between tests. This setting can't be combined with **OrderTestsByNameInClass**.| |
Collaborator
There was a problem hiding this comment.
All the setting names should be put into backticks to prevent localization. You can see here in German that a few setting names are being localized.
Member
Author
There was a problem hiding this comment.
Fixed in d8d42d4 — the runsettings MSTest element table now wraps all setting names (and literal values like MethodLevel/ClassLevel/EndOfAssembly) in backticks instead of bold so they're not localized.
…g-execution.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents three MSTest 4.3 configuration features that were missing from the docs. Unlike the new
AssertAPIs (which are blocked until 4.3 publishes its API reference), these are config/MSBuild features that need no API xrefs, so they're documentable now.Changes to
unit-testing-mstest-configure.mdRandomizeTestOrder(opt-in random test order) andRandomTestOrderSeed(reproducible seed).randomizeTestOrderandrandomTestOrderSeedequivalents.MSBuild propertiessection: documentsMSTestParallelizeScopeandMSTestParallelizeWorkersfor opting into assembly-level parallelization from the project file / Directory.Build.props (requiresGenerateAssemblyInfo=true;Noneemits[assembly: DoNotParallelize]).Changes to
unit-testing-mstest-writing-tests-controlling-execution.mdContent source
RandomizeTestOrder/RandomTestOrderSeedelement + testconfig keys (execution:randomizeTestOrder,execution:randomTestOrderSeed) and the OrderTestsByNameInClass conflict: verified from microsoft/testfxMSTestSettings.RunSettingsXml.csandMSTestSettings.Configuration.cs.MSTestParallelizeScope/MSTestParallelizeWorkerssemantics, valid values, andGenerateAssemblyInforequirement: verified fromParallelize.targets.ai-usage: ai-assisted
Internal previews