Skip to content

docs: add vstest.console CLI options reference and document missing env vars - #16286

Merged
Azat Mukhametshin (azat-msft) merged 20 commits into
microsoft:mainfrom
azat-msft:docs-cli-reference-and-missing-envvars
Jul 17, 2026
Merged

docs: add vstest.console CLI options reference and document missing env vars#16286
Azat Mukhametshin (azat-msft) merged 20 commits into
microsoft:mainfrom
azat-msft:docs-cli-reference-and-missing-envvars

Conversation

@azat-msft

@azat-msft Azat Mukhametshin (azat-msft) commented Jul 15, 2026

Copy link
Copy Markdown
Member

Part of a documentation completeness audit (checking docs against the actual code). This PR fills two gaps not covered by the other open docs PRs (#16277, #16278, #16279):

1. New docs/commandline.md — vstest.console.exe options reference

There was no in-repo reference for vstest.console.exe command line options; they were only discoverable via the runtime --Help output or external Microsoft Learn. This adds a source-grounded reference covering every user-facing option, generated from the argument processors in src/vstest.console/Processors and mirroring the --Help text: /Tests, /TestCaseFilter, /ListTests, /Parallel, /InIsolation, /Platform, /Framework, /Environment, /TestAdapterPath, /Settings, -- [name]=[value], /logger, /Collect, /Blame, /ResultsDirectory, /Diag, /Help, @<file>, /Port, /ParentProcessId. Internal/hidden switches (including /TestAdapterLoadingStrategy) are enumerated in an "Omitted switches" section.

2. Missing environment variables in docs/environment-variables.md

Five variables referenced in src/ were undocumented (verified they are not added by #16279):

  • VSTEST_DOTNET_ROOT_PATH
  • VSTEST_DOTNET_ROOT_ARCHITECTURE
  • VSTEST_BACKGROUND_DISCOVERY
  • VSTEST_DISABLE_DOTNET_ROOT_ON_NONWINDOWS
  • VSTEST_DISABLE_DYNAMICNATIVE_CODECOVERAGE_DEFAULT_SETTING

3. README documentation index

Adds a Guides subsection linking the existing how-to docs (command line, filter, runsettings, configure, coverage, diagnostics), which previously were not indexed.

4. --Help text corrections (product resource change)

While grounding the CLI reference against the argument processors, two vstest.console --Help strings were found to be inaccurate and are corrected in src/vstest.console/Resources/Resources.resx (with matching *.xlf source updates, targets flagged for re-translation):

  • /Platform now lists all supported architectures (x86, x64, ARM, ARM64, S390x, Ppc64le, RiscV64, LoongArch64) instead of only x86/x64/ARM.
  • /Framework now points out the common short TFM monikers (net48, net10.0) alongside the long forms.

Apart from those corrected --Help resource strings, this is a documentation-only change.

…nv vars

Adds a source-grounded docs/commandline.md covering every user-facing
vstest.console.exe option (mirrors --Help / the argument processors), and
documents five environment variables that were referenced in src/ but missing
from environment-variables.md:

- VSTEST_DOTNET_ROOT_PATH
- VSTEST_DOTNET_ROOT_ARCHITECTURE
- VSTEST_BACKGROUND_DISCOVERY
- VSTEST_DISABLE_DOTNET_ROOT_ON_NONWINDOWS
- VSTEST_DISABLE_DYNAMICNATIVE_CODECOVERAGE_DEFAULT_SETTING

Also links the how-to guides from the README documentation index.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3012d638-7bdb-4b0f-8731-35c9ab2aa258
Copilot AI review requested due to automatic review settings July 15, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves in-repo documentation coverage for the VSTest platform by adding a vstest.console.exe command-line reference, documenting previously-missing environment variables, and indexing key guides from the repository README.

Changes:

  • Add a new docs/commandline.md reference for vstest.console.exe options, aligned with the in-product help text and argument processors.
  • Document additional environment variables used by the platform in docs/environment-variables.md.
  • Add a “Guides” section to README.md to make existing documentation easier to discover.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
README.md Adds a “Guides” subsection linking to the primary how-to docs.
docs/environment-variables.md Documents additional env vars (DOTNET_ROOT-related, background discovery hint, code coverage default behavior flag).
docs/commandline.md Adds a comprehensive command-line options reference for vstest.console.exe.

Comment thread docs/commandline.md Outdated
Comment thread docs/commandline.md Outdated
Comment thread docs/environment-variables.md Outdated
Comment thread docs/environment-variables.md Outdated
Comment thread docs/commandline.md Outdated
Roadmap (docs/releases.md) is already linked from the dedicated ## Roadmap
section, so it is removed from the merged list to avoid duplication.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3012d638-7bdb-4b0f-8731-35c9ab2aa258
Copilot AI review requested due to automatic review settings July 15, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread docs/commandline.md
Comment thread docs/commandline.md Outdated
Comment thread docs/environment-variables.md Outdated
Comment thread docs/environment-variables.md Outdated
commandline.md:
- /Platform: list the full set of accepted Architecture values (ARM64, S390x,
  Ppc64le, RiscV64, LoongArch64) not just x86/x64/ARM
- @<file>: correct response-file parsing (whitespace-separated, quoting; not
  one-option-per-line)
- clarify short-form options accept a '/' or '-' prefix (e.g. -e, -lt)
- soften 'actively maintained reference' wording

environment-variables.md:
- VSTEST_DISABLE_DOTNET_ROOT_ON_NONWINDOWS: describe the actual behavior
  (architecture-specific DOTNET_ROOT_<ARCH>, gated on a known dotnet root path)
- VSTEST_BACKGROUND_DISCOVERY: it is propagated into the testhost process
  environment (and also lowers testhost priority)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3012d638-7bdb-4b0f-8731-35c9ab2aa258
Copilot AI review requested due to automatic review settings July 15, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread docs/commandline.md Outdated
Comment thread docs/environment-variables.md Outdated
Comment thread docs/environment-variables.md Outdated
Comment thread README.md
Adds an Exit codes section to commandline.md (0 = success, 1 = failure; the
process never returns any other value) plus a 'When no tests are found'
subsection covering the warning messages emitted for empty filter/selection/
source discovery and the non-uniform exit code across those cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3012d638-7bdb-4b0f-8731-35c9ab2aa258
Copilot AI review requested due to automatic review settings July 15, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread docs/commandline.md Outdated
Comment thread docs/commandline.md
Populates the previously-empty quickstart.md with a CLI-focused getting-started
guide: choosing dotnet test vs vstest.console.exe (and the deprecated dotnet
vstest), acquiring the standalone runner from the Microsoft.TestPlatform NuGet
package, a first run, common tasks, and exit codes. Links it from the README
Guides index.

Note: quickstart.md content is also touched by another in-flight PR; the two
will be reconciled at merge time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3012d638-7bdb-4b0f-8731-35c9ab2aa258
Copilot AI review requested due to automatic review settings July 15, 2026 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread README.md
Comment thread docs/quickstart.md Outdated
Comment thread docs/environment-variables.md Outdated
…d-missing-envvars

# Conflicts:
#	docs/quickstart.md
Copilot AI review requested due to automatic review settings July 15, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread docs/environment-variables.md Outdated
Comment thread docs/commandline.md Outdated
Comment thread docs/commandline.md Outdated
commandline.md:
- scope the intro to the --Help options and note that internal/legacy/hidden
  switches (/EnableCodeCoverage, /UseVsixExtensions, internal /List*, etc.) are
  intentionally omitted, so it no longer implies completeness
- use forward slashes in wildcard examples for cross-platform correctness
- match the real 'no test matches filter' message (filter shown in backticks)
- correct the no-tests exit code: it is 0 by default and only 1 when
  RunConfiguration.TreatNoTestsAsError=true (not a /Tests-vs-filter split)

environment-variables.md:
- feature flags are enabled for any value other than 0 (not just 'non-zero');
  clarify the ambiguous 'to disable' wording
- VSTEST_BACKGROUND_DISCOVERY reduces parallelism for both discovery and
  execution, not discovery only

quickstart.md:
- use forward slashes in the cross-platform runner path and wildcard examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3012d638-7bdb-4b0f-8731-35c9ab2aa258
Copilot AI review requested due to automatic review settings July 15, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread README.md
Comment thread docs/commandline.md Outdated
[`src/vstest.console/Processors`](../src/vstest.console/Processors) and mirrors the built-in
`--Help` output.

`vstest.console.exe` also accepts a number of internal, legacy, or hidden switches that are

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a second paragraph, that should have the most important info, instead we tell them what we will not show them, move this to the bottom of the article, so it is searchable but not in our face.

Comment thread docs/commandline.md
Comment thread docs/commandline.md
Comment thread docs/commandline.md Outdated
Comment thread docs/commandline.md Outdated
Comment thread docs/commandline.md Outdated
Comment thread docs/commandline.md Outdated

Makes `vstest.console.exe` use custom test adapters from the given path in the test run.

### `/TestAdapterLoadingStrategy:<strategy>`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned elsewhere, maybe this should be removed, and the option not documented.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TestAdapterLoadingStrategy is moved to the "Omitted switches" section.
Should it be removed from the --Help output as well?

Comment thread docs/commandline.md Outdated
Copilot AI review requested due to automatic review settings July 16, 2026 12:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 14 comments.

Comment thread docs/commandline.md Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.tr.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.ru.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.it.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.fr.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.es.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.de.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.cs.xlf Outdated
Point the /logger section solely at docs/report.md for the full list of loggers and options instead of the external console-logger aka.ms link.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f53a115c-0178-46a7-ac37-2e5ac1676f10
Copilot AI review requested due to automatic review settings July 16, 2026 13:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 14 comments.

Comment thread src/vstest.console/Resources/xlf/Resources.zh-Hant.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.zh-Hans.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.tr.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.ru.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.pt-BR.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.fr.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.es.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.de.xlf Outdated
Comment thread src/vstest.console/Resources/xlf/Resources.cs.xlf Outdated
Comment thread docs/commandline.md Outdated
- Re-add the UTF-8 BOM that was accidentally stripped from the 13 vstest.console .xlf files (matches the rest of the repo and avoids noisy diffs/tooling breakage).

- Reword the commandline.md intro so it no longer claims to fully mirror --Help, and point readers to the Omitted switches section (avoids the contradiction with /TestAdapterLoadingStrategy).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f53a115c-0178-46a7-ac37-2e5ac1676f10
Copilot AI review requested due to automatic review settings July 16, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread docs/commandline.md
…processors

There is no generator script producing docs/commandline.md; 'derived from' is accurate and avoids implying an automated guarantee.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f53a115c-0178-46a7-ac37-2e5ac1676f10
Copilot AI review requested due to automatic review settings July 16, 2026 13:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Comment thread docs/commandline.md
Comment thread docs/commandline.md Outdated
Add /ListDiscoverers, /ListExecutors, /ListLoggers and /ListSettingsProviders (they use a private CommandName const and were missed earlier), and reword the intro so it no longer claims a single --Help exception, since both /TestAdapterLoadingStrategy and /RunTests have --Help entries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f53a115c-0178-46a7-ac37-2e5ac1676f10
Copilot AI review requested due to automatic review settings July 16, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

The PlatformArgumentProcessorTests and FrameworkArgumentProcessorTests assert on the exact PlatformArgumentHelp/FrameworkArgumentHelp resource strings, which were updated to list all architectures and short TFM monikers. Update the expected values (and the generated Designer.cs doc comments) accordingly. Verified all 21 tests pass in Release.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f53a115c-0178-46a7-ac37-2e5ac1676f10
Copilot AI review requested due to automatic review settings July 16, 2026 14:27
- VSTEST_DOTNET_ROOT_PATH: the variable vstest sets depends on the testhost — DOTNET_ROOT_<ARCH> for net8+ (17.14+) hosts, but DOTNET_ROOT(x86) for x86 or the architecture-less DOTNET_ROOT otherwise on older netcoreapp3.1 hosts.

- VSTEST_DISABLE_DOTNET_ROOT_ON_NONWINDOWS: note that deriving the dotnet root from DOTNET_ROOT only happens on Windows (the dotnet.exe PE-header architecture probe returns nothing on Linux/macOS).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f53a115c-0178-46a7-ac37-2e5ac1676f10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • src/vstest.console/Resources/Resources.Designer.cs: Generated file

Comment thread docs/environment-variables.md Outdated
Comment thread docs/commandline.md
Copilot AI review requested due to automatic review settings July 16, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • src/vstest.console/Resources/Resources.Designer.cs: Generated file

@azat-msft
Azat Mukhametshin (azat-msft) merged commit 3026de6 into microsoft:main Jul 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants