-
Notifications
You must be signed in to change notification settings - Fork 302
Drop the ObjectModel package reference from PlatformServices (Phase 7 capstone) #9633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Evangelink
merged 28 commits into
main
from
dev/amauryleve/vstest-decoupling-drop-objectmodel
Jul 7, 2026
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5b07073
Abstract VSTest message logging in PlatformServices (Phase 0/1)
40cabbb
Abstract VSTest result reporting in PlatformServices (Phase 5)
Evangelink f05621d
Address review comments on Phase 1 logging PR
3f85af0
Clarify ITestResultRecorder remarks re: platform boundary
Evangelink 7fd1fcc
Merge remote-tracking branch 'origin/dev/amauryleve/abstract-vstest-r…
f1e1f36
Abstract VSTest test filtering in PlatformServices (Phase 2 of platfo…
Evangelink f846008
Abstract VSTest discovery sink in PlatformServices (Phase 3 of platfo…
Evangelink 4f02b6e
Abstract VSTest execution input in PlatformServices (Phase 4 of platf…
Evangelink 98ec16e
Neutralize deployment input in PlatformServices (Phase 6a of platform…
Evangelink 371124a
Neutralize test result recording in PlatformServices (Phase 6b) (#9579)
Evangelink 274e479
Neutralize test message logging in PlatformServices execution engine …
Evangelink 1a37ffa
Neutralize run-settings input in PlatformServices host layer (Phase 6c2)
dc4c4d8
Move test-case filter parsing to adapter boundary (Phase 6d-1)
7caa937
Remove VSTest run/discovery context from PlatformServices (Phase 6d-2)
668335a
Remove IFrameworkHandle from the PlatformServices execution engine (P…
1e61c13
Relocate VSTest logger/sink bridges to the adapter (Phase 6e-2)
Evangelink ab2cc59
Neutralize the trait type on UnitTestElement (Phase 6e-3a)
Evangelink 1ffa5fa
Relocate the UnitTestElement<->TestCase conversion to the adapter (Ph…
Evangelink fbcafef
Neutralize runsettings parsing helpers (Phase 6e-4a)
Evangelink 24e471c
Resolve the object-model assembly by name in AppDomain wiring (Phase …
Evangelink 8261580
Resolve source-host anchor assemblies by name (Phase 6e-4c1)
Evangelink e6dc77c
Reimplement the source assembly-reference check without ObjectModel (…
Evangelink 9197a3f
Vendor a neutral SuspendCodeCoverage in PlatformServices (Phase 6e-4c3)
Evangelink 16552c6
Drop the ObjectModel package reference from PlatformServices (Phase 7)
Evangelink ce6569b
Handle null/empty public key tokens in ArePublicKeyTokensEqual
Evangelink b2a5341
Merge remote-tracking branch 'origin/main' into dev/amauryleve/vstest…
Evangelink b3a8b1e
Resolve post-merge semantic conflicts after merging main
Evangelink 8191388
Add DesktopTestSourceTests coverage for public key token mismatch
Evangelink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
src/Adapter/MSTestAdapter.PlatformServices/ApartmentStateSetting.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; | ||
|
|
||
| /// <summary> | ||
| /// Apartment state parsed from the <c>ExecutionThreadApartmentState</c> run settings and the | ||
| /// <c>mstest:execution:executionApartmentState</c> configuration value. This is the adapter's own neutral | ||
| /// replacement for the former VSTest <c>PlatformAbstractions.PlatformApartmentState</c> enum. | ||
| /// </summary> | ||
| internal enum ApartmentStateSetting | ||
| { | ||
| // The member order is load-bearing: Enum.TryParse maps numeric-string run settings values ("0"/"1") | ||
| // by number, so MTA must stay 0 and STA must stay 1 to preserve parse compatibility with the former | ||
| // VSTest PlatformAbstractions.PlatformApartmentState enum. Do not reorder. | ||
| MTA, | ||
| STA, | ||
| } |
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
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
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
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
29 changes: 29 additions & 0 deletions
29
test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/ObjectModelDecouplingTests.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| using AwesomeAssertions; | ||
|
|
||
| using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices; | ||
|
|
||
| using TestFramework.ForTestingMSTest; | ||
|
|
||
| namespace MSTestAdapter.PlatformServices.UnitTests; | ||
|
|
||
| public class ObjectModelDecouplingTests : TestContainer | ||
| { | ||
| // Guards the platform-agnostic contract: the compiled MSTestAdapter.PlatformServices assembly must not | ||
| // reference the VSTest object model (Microsoft.VisualStudio.TestPlatform.ObjectModel) or any other | ||
| // Microsoft.*.TestPlatform.* assembly. All VSTest coupling lives in the MSTest.TestAdapter layer above it. | ||
| public void PlatformServicesAssemblyShouldNotReferenceAnyTestPlatformAssembly() | ||
| { | ||
| Assembly platformServices = typeof(TestSourceHandler).Assembly; | ||
|
|
||
| IEnumerable<string> testPlatformReferences = platformServices | ||
| .GetReferencedAssemblies() | ||
| .Select(reference => reference.Name!) | ||
| .Where(name => name.IndexOf("TestPlatform", StringComparison.OrdinalIgnoreCase) >= 0); | ||
|
|
||
| testPlatformReferences.Should().BeEmpty( | ||
| "PlatformServices must stay platform-agnostic and must not reference the VSTest object model or any Microsoft.*.TestPlatform.* assembly"); | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.