Skip to content

Expose dotnet host selection in VsTestConsoleWrapper - #16802

Merged
Azat Mukhametshin (azat-msft) merged 1 commit into
microsoft:mainfrom
emaf:emaf-dev/ema/vstest-host-selection
Dec 3, 2026
Merged

Azat Mukhametshin (azat-msft) merged 1 commit into
microsoft:mainfrom
emaf:emaf-dev/ema/vstest-host-selection

Conversation

@emaf

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 51c208b71fcf35052241b9e1e10030f67c4daa11

Dimension Assessment Rationale
Change confidence 8/10 ↑ Existing host-selection implementation is exposed without changing the shipped constructors; all library target frameworks build and 115 .NET 12 tests passed.
↓ No end-to-end test launches a console with the selected host; net481 tests were not run on macOS.

Description

Expose the existing VsTestConsoleWrapper constructor that accepts a dotnet executable path, allowing a caller to choose the host for vstest.console.dll without changing process-wide PATH. Keep existing constructors and default host selection unchanged. Document the option and add focused tests for public availability and host selection.

Validation:

  • ./build.sh -c Release --projects "$PWD/test/TranslationLayer.UnitTests/TranslationLayer.UnitTests.csproj" — passed; seven existing trim-analysis warnings.
  • ./build.sh -c Release --projects "$PWD/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Microsoft.TestPlatform.VsTestConsole.TranslationLayer.csproj" — passed for net462, net10.0, and netstandard2.0.
  • DOTNET_ROOT="$PWD/.dotnet" ./.dotnet/dotnet test --project test/TranslationLayer.UnitTests/TranslationLayer.UnitTests.csproj -c Release -f net12.0 -- --report-trx — passed, 115 tests; TRX parsed and outcomes verified. net481 was compiled but not run on macOS.

Related issue

Fixes #16801

  • I have ensured that there is a previously discussed and approved issue.

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

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.

🟢 Approval recommended

No active review issues remain for the change exposing per-wrapper dotnet host selection.

No open issues 🎉

What changed in this PR

Exposes per-wrapper dotnet host selection in VSTest’s translation layer, addressing #16801 without requiring process-wide PATH changes. Existing constructors and default host resolution remain unchanged.

Changes:

  • Makes the existing host-path constructor public and registers it in the public API baseline.
  • Documents explicit host selection, empty-path fallback, and direct executable launching.
  • Adds tests for constructor visibility and explicit host-path handling without modifying PATH.
File Description
test/​TranslationLayer.UnitTests/​VsTestConsoleWrapperTests.cs Tests public constructor availability and host-path handling.
src/​Microsoft.TestPlatform.VsTestConsole.TranslationLayer/​VsTestConsoleWrapper.cs Exposes and documents the host-path constructor.
src/​Microsoft.TestPlatform.VsTestConsole.TranslationLayer/​README.md Adds usage guidance and explains host-selection behavior.
src/​Microsoft.TestPlatform.VsTestConsole.TranslationLayer/​PublicAPI/​PublicAPI.Unshipped.txt Registers the newly public constructor.

Review effort: Balanced

@nohwnd

Copy link
Copy Markdown
Member

Yup, thanks

@azat-msft

Copy link
Copy Markdown
Member

/azp run microsoft.vstest

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azat-msft
Azat Mukhametshin (azat-msft) merged commit 911fd35 into microsoft:main Dec 3, 2026
27 checks passed
@emaf
Emanuel Fernandez Dell'Oca (emaf) deleted the emaf-dev/ema/vstest-host-selection branch December 4, 2026 16:34
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.

Expose the dotnet host path in VsTestConsoleWrapper

4 participants