Skip to content

Neutralize run-settings input in PlatformServices host layer (Phase 6c2)#9590

Draft
Evangelink wants to merge 1 commit into
dev/amauryleve/vstest-decoupling-basefrom
dev/amauryleve/vstest-decoupling-settings
Draft

Neutralize run-settings input in PlatformServices host layer (Phase 6c2)#9590
Evangelink wants to merge 1 commit into
dev/amauryleve/vstest-decoupling-basefrom
dev/amauryleve/vstest-decoupling-settings

Conversation

@Evangelink

@Evangelink Evangelink commented Jul 3, 2026

Copy link
Copy Markdown
Member

Phase 6c2 of the PlatformServices platform-agnostic initiative

Part of removing the VSTest object model (Microsoft.TestPlatform.ObjectModel) dependency from MSTestAdapter.PlatformServices, moving VSTest coupling up into MSTest.TestAdapter.

This phase removes the VSTest IRunSettings type: it threads a neutral settings-XML string through the isolation-host layer instead. Only IRunSettings.SettingsXml (a string) was ever read across PlatformServices, so this is a mechanical, byte-for-byte substitution.

What changed

  • IPlatformServiceProvider.CreateTestSourceHost(string, IRunSettings?)(string, string? settingsXml).
  • TestSourceHost (both ctors, incl. the netfx AppDomain path) and AssemblyEnumeratorWrapper.GetTests/GetTestsInIsolationstring? settingsXml.
  • TestExecutionManager.CacheSessionParameters takes the settings-XML string directly.
  • Callers extract runContext?.RunSettings?.SettingsXml / discoveryContext?.RunSettings?.SettingsXml at the point they already held the (still-VSTest) run/discovery context.

No behavior change

The AppDomain DisableAppDomain decision and run-parameter caching read the same settings XML as before. The one guard (runSettings != null && …settingsXml is not null && …) is byte-for-byte for all realistic inputs and matches the existing DeploymentUtilityBase precedent (expert-reviewer confirmed the only theoretical divergence is unreachable). IRunSettings is now fully gone from PlatformServices code (only a doc-comment mention remains). The remaining IRunContext/IDiscoveryContext usage is the test-case filter, deferred to the filter sub-phase.

Verification

  • Full build green across all TFMs (net462, net8.0, net9.0, UWP, WinUI).
  • MSTestAdapter.PlatformServices.UnitTests: 897 (net8.0) / 935 (net462); MSTest.IntegrationTests: 47 pass / 1 skip; PlatformServices.Desktop.IntegrationTests: 15 pass (exercises the AppDomain assembly-resolution-from-runsettings path — validates the settings-xml threads correctly through the child domain).
  • Expert MSTest/MTP reviewer: no material findings; gave the AppDomain guard change a definitive byte-for-byte verdict.

Base

Remaining work

Replace the VSTest IRunSettings with a neutral settings-XML string through the
isolation-host layer, removing IRunSettings from MSTestAdapter.PlatformServices.

- IPlatformServiceProvider.CreateTestSourceHost, TestSourceHost (both ctors) and
  AssemblyEnumeratorWrapper.GetTests/GetTestsInIsolation now take string? settingsXml.
- TestExecutionManager.CacheSessionParameters takes the settings-XML string directly.
- Callers extract runContext?.RunSettings?.SettingsXml / discoveryContext?.RunSettings?.SettingsXml
  at the point they already had the (still VSTest) run/discovery context; only .SettingsXml
  (a string) was ever read off IRunSettings, so this is byte-for-byte.

The remaining IRunContext/IDiscoveryContext usage is the test-case filter (deferred to the
filter sub-phase). No behavior change: the appdomain DisableAppDomain decision and the
run-parameter caching read the same settings XML as before.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant