Neutralize run-settings input in PlatformServices host layer (Phase 6c2)#9590
Draft
Evangelink wants to merge 1 commit into
Draft
Conversation
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>
0c0970d to
1a37ffa
Compare
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.
Phase 6c2 of the PlatformServices platform-agnostic initiative
Part of removing the VSTest object model (
Microsoft.TestPlatform.ObjectModel) dependency fromMSTestAdapter.PlatformServices, moving VSTest coupling up intoMSTest.TestAdapter.This phase removes the VSTest
IRunSettingstype: it threads a neutral settings-XML string through the isolation-host layer instead. OnlyIRunSettings.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) andAssemblyEnumeratorWrapper.GetTests/GetTestsInIsolation→string? settingsXml.TestExecutionManager.CacheSessionParameterstakes the settings-XML string directly.runContext?.RunSettings?.SettingsXml/discoveryContext?.RunSettings?.SettingsXmlat the point they already held the (still-VSTest) run/discovery context.No behavior change
The AppDomain
DisableAppDomaindecision 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 existingDeploymentUtilityBaseprecedent (expert-reviewer confirmed the only theoretical divergence is unreachable).IRunSettingsis now fully gone from PlatformServices code (only a doc-comment mention remains). The remainingIRunContext/IDiscoveryContextusage is the test-case filter, deferred to the filter sub-phase.Verification
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).Base
dev/amauryleve/vstest-decoupling-base, which already contains Phase 3 (Abstract VSTest discovery sink in PlatformServices (Phase 3 of platform-agnostic effort) #9566), 4 (Abstract VSTest execution input in PlatformServices (Phase 4 of platform-agnostic effort) #9572), 6a (Neutralize deployment input in PlatformServices (Phase 6a of platform-agnostic effort) #9576), 6b (Neutralize test result recording in PlatformServices (Phase 6b) #9579), and 6c (Neutralize test message logging in PlatformServices execution engine (Phase 6c) #9585). Developed stacked on 6c; 6c has since merged into the base, so the diff here is 6c2 only (11 files).Remaining work
IRunContext/IDiscoveryContext/ITestCaseFilterExpression→ boundary; folds in Avoid double TestCase construction when filtering during discovery/execution (platform-agnostic refactor follow-up) #9568).UnitTestElement↔TestCaseconversion +EngineConstantsVSTest properties.Microsoft.TestPlatform.ObjectModelPackageReference + guard test.