Skip to content

Drop MSTest's VSTest bridge dependency on the MTP path#9755

Merged
Evangelink merged 1 commit into
mainfrom
dev/amauryleve/phase6b-drop-bridge
Jul 8, 2026
Merged

Drop MSTest's VSTest bridge dependency on the MTP path#9755
Evangelink merged 1 commit into
mainfrom
dev/amauryleve/phase6b-drop-bridge

Conversation

@Evangelink

Copy link
Copy Markdown
Member

What

Complete Phase 6b of the native MTP integration work by making MSTest's Microsoft.Testing.Platform path native-only.

This follows:

This PR is the final flip/removal step: MSTest no longer routes the MTP path through Microsoft.Testing.Extensions.VSTestBridge.

Changes

  • Remove MSTestBridgedTestFramework from MSTest.TestAdapter.
  • Stop gating MTP registration behind MSTEST_EXPERIMENTAL_NATIVE_MTP; MSTestTestFramework is now the only MTP test framework.
  • Drop the MSTest.TestAdapter project reference to Microsoft.Testing.Extensions.VSTestBridge.
  • Add the direct dependencies that used to flow transitively through the bridge:
    • Microsoft.Testing.Extensions.TrxReport.Abstractions
    • Microsoft.Testing.Extensions.Telemetry
    • Microsoft.TestPlatform.ObjectModel
  • Rename BridgedConfiguration to PlatformServicesConfigurationAdapter.
  • Update trim/discovery tests and comments to the native-only topology.

Validation

  • build.cmd clean
  • MSTestAdapter.UnitTests: 45/45
  • MSTestAdapter.PlatformServices.UnitTests: 898/898
  • build.cmd -pack clean; package validation clean
  • MSTest acceptance high-signal slice green (RunsettingsTests, FilterTests, HelpInfoTests, TrxReportTests, ThreadingTests)
  • Full MSTest acceptance: only the 3 pre-existing local NativeAOT failures remain
    • NativeAotTests_WillRunWithExitCodeZero (net8.0)
    • NativeAotTests_WillRunWithExitCodeZero (net10.0)
    • NativeAot_Smoke_Test

Those 3 failures are the same local trim-warning environment issue already observed before this PR; the focused trim regression tests were updated and pass on the native-only graph.

Notes

The package graph is now what we wanted from the beginning of this effort:

  • removed: Microsoft.Testing.Extensions.VSTestBridge
  • direct: Microsoft.Testing.Extensions.TrxReport.Abstractions, Microsoft.Testing.Extensions.Telemetry, Microsoft.TestPlatform.ObjectModel

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

Complete Phase 6b of the native MTP integration work by making MSTest's
Microsoft.Testing.Platform path native-only.

- Remove MSTestBridgedTestFramework and stop gating registration behind
  MSTEST_EXPERIMENTAL_NATIVE_MTP.
- Register MSTestTestFramework as the only MTP test framework.
- Drop the MSTest.TestAdapter project reference to
  Microsoft.Testing.Extensions.VSTestBridge.
- Add the direct dependencies that used to flow through the bridge:
  Microsoft.Testing.Extensions.TrxReport.Abstractions,
  Microsoft.Testing.Extensions.Telemetry, and Microsoft.TestPlatform.ObjectModel.
- Rename BridgedConfiguration to PlatformServicesConfigurationAdapter.
- Update trim/discovery tests and comments to the native-only topology.

Validated:
- build.cmd clean
- MSTestAdapter.UnitTests: 45/45
- MSTestAdapter.PlatformServices.UnitTests: 898/898
- build.cmd -pack clean, package validation clean
- MSTest acceptance high-signal slice green
- Full MSTest acceptance: only the 3 pre-existing local NativeAOT failures remain
  (same trim-warning environment issue as before)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 20:28
@Evangelink Evangelink added the state/needs-review Awaiting review from the team. label Jul 8, 2026
@Evangelink
Evangelink enabled auto-merge (squash) July 8, 2026 20:30

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 completes Phase 6b of the native Microsoft.Testing.Platform (MTP) integration for MSTest (RFC 018). It flips MSTest's MTP path to be native-only: MSTestTestFramework becomes the sole MTP test framework, the VSTest bridge framework and its opt-in gate are removed, and MSTest's MSTest.TestAdapter package no longer depends on Microsoft.Testing.Extensions.VSTestBridge. This finalizes the decoupling so MSTest plugs into MTP directly instead of round-tripping through the VSTest object model.

Changes:

  • Remove MSTestBridgedTestFramework and the MSTEST_EXPERIMENTAL_NATIVE_MTP gating; MSTestTestFramework is now always used, and MSTestCapabilities implements only the native IMSTestTrxReportCapability.
  • Swap the MSTest.TestAdapter project reference to Microsoft.Testing.Extensions.VSTestBridge for direct references to TrxReport.Abstractions, Telemetry, and an unconditional Microsoft.TestPlatform.ObjectModel.
  • Rename BridgedConfiguration to PlatformServicesConfigurationAdapter, and update trim/discovery tests and code comments to the native-only topology.
Show a summary per file
File Description
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs Deletes the now-unused VSTest bridge framework.
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs Drops the env-var gate; always registers MSTestTestFramework; MSTestCapabilities implements only the native TRX capability.
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/PlatformServicesConfigurationAdapter.cs Renames BridgedConfiguration to PlatformServicesConfigurationAdapter.
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestFramework.cs Updates the field type to the renamed adapter and clarifies the class summary (removes opt-in remarks).
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestFilterContext.cs Comment update to describe the former bridge behavior in past tense.
src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestTestNodeConverter.cs Comment updates referencing the bridge in past tense.
src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestDiscoverer.cs Comment update: internal constructor is used by the native framework.
src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj Replaces the VSTestBridge reference with direct TrxReport.Abstractions/Telemetry references and makes Microsoft.TestPlatform.ObjectModel unconditional.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TrimTests.cs Updates trimmer root assemblies (drops VSTestBridge, adds MSTest.TestAdapter) and comments for the Application Insights telemetry dependency.
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/TestDiscoveryTests.cs Comment update reflecting that MSTest natively leaves assemblyFullName/returnTypeFullName empty.

Review details

  • Files reviewed: 10/10 changed files
  • Comments generated: 0
  • Review effort level: Medium

@github-actions github-actions Bot 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Review Summary — PR #9755: Drop MSTest's VSTest bridge dependency on the MTP path

Clean, well-scoped PR that completes Phase 6b of the native MTP integration. The removal of MSTestBridgedTestFramework, the MSTEST_EXPERIMENTAL_NATIVE_MTP feature flag, and the bridge project reference are all consistent — no dangling references remain in production or test code.

Verdict Table

# Dimension Verdict Notes
1 Algorithmic Correctness ✅ Pass Registration logic simplified; single-path factory is correct
2 Threading & Concurrency ✅ Pass CountdownEvent-based session guard unchanged
3 Exception Handling ✅ Pass No changes to exception semantics
4 Resource Management ✅ Pass IDisposable pattern unchanged
5 API Design & Contracts ✅ Pass Public surface unchanged; AddMSTest signature intact
6 Performance & Allocation ✅ Pass Removes dead-code Environment.GetEnvironmentVariable check on hot path
7 Cross-TFM / Platform ✅ Pass ObjectModel now unconditional (UWP + netfx + net8+); UWP guard preserved on MTP-only refs
8 Backward Compatibility ✅ Pass Experimental flag removed (never shipped publicly); native path was already the production path for anyone opting in
9 Public API Surface ✅ Pass No new public API; PublicAPI.Unshipped.txt empty
10 Security ✅ Pass No security-sensitive changes
11 Localization ✅ Pass No new resources; existing .xlf files untouched
12 Test Quality ✅ Pass Trim/discovery tests properly updated for the new topology
13 Documentation & Comments ⚠️ Minor One stale comment in .csproj (see inline)
14 Naming Conventions i️ Info VSTestBridgedTestFrameworkSessionAlreadyCreatedErrorMessage resource still uses "Bridged" — cosmetic; renaming would churn 13 .xlf files for no functional gain
15 Code Duplication ✅ Pass Bridge code deleted, not duplicated
16 Error Propagation ✅ Pass Session-already-created error unchanged
17 Dependency Management ✅ Pass Transitive deps made explicit correctly (TrxReport.Abstractions, Telemetry, ObjectModel)
18 Build & Project File ✅ Pass Conditions and PrivateAssets settings are correct
19 Diagnostic & Observability ✅ Pass Trace logger wiring unchanged
20 Scope Discipline ✅ Pass Changes are tightly scoped to bridge removal
21 Style & Formatting ✅ Pass Consistent with codebase conventions
22 TODO Policy ✅ Pass Removed the untracked TODO from the bridge; no new TODOs added

One Minor Finding

The .csproj comment about Microsoft.TestPlatform.Filter.Source (lines 93–95) still uses present tense ("It flows in transitively via the VSTestBridge today") despite the bridge reference being removed in this PR. See inline suggestion.

Overall: Excellent, clean execution. No blocking or major issues. 👍

Comments that could not be inline-anchored

src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj:95

MINOR — Stale comment (present tense about removed dependency)

This comment still says "It flows in transitively via the VSTestBridge today" — but the VSTestBridge reference was removed in this very PR. The ObjectModel comment just above (lines 87–90) was correctly updated to past tense; this one should match:

    &lt;!-- The native Microsoft.Testing.Platform integration (TestingPlatformAdapter\MSTestFilterContext, guarded by
         !WINDOWS_UWP) parses VSTest filter expressi…

</details>

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🧪 Test quality grade — PR #9755

GradeTestNotes
B (80–89) mod TestDiscoveryTests.
DiscoverTests_
WithJsonOutput_
ProducesValidJsonDocumentWithExpectedFields
Comprehensive JSON coverage; split per-behavior (exit code, schema, display names) to ease failure diagnosis.
B (80–89) mod TrimTests.
Publish_
WithSourceGeneration_
DoesNotSurfaceMSTestOwnedTrimWarnings
Clear absence assertions; add an exit-code check before the warning scan to surface publish failures explicitly.
B (80–89) mod TrimTests.
Publish_
WithTestAdapter_
DoesNotSurfaceWarningsFromSuppressedSources
Well-commented regression test; add an exit-code check before the absence scan to surface publish failures explicitly.

This advisory comment was generated automatically. Grades are heuristic
and informational — they do not block merging. Re-run with
/grade-tests.

🤖 Automated content by GitHub Copilot. Generated by the Grade Tests on PR (on open / sync) workflow. · 100.4 AIC · ⌖ 12.2 AIC · ⊞ 9.5K · [◷]( · )

@Evangelink
Evangelink merged commit fe6d831 into main Jul 8, 2026
41 checks passed
@Evangelink
Evangelink deleted the dev/amauryleve/phase6b-drop-bridge branch July 8, 2026 23:23
github-actions Bot added a commit that referenced this pull request Jul 9, 2026
- AzureFoundry: add DefaultAzureCredential/managed identity auth details
  and required environment variables (PR #9707)
- MSTestTestFramework: new entry documenting the native MTP ITestFramework
  for MSTest introduced by RFC 018 (PRs #9706, #9743, #9748, #9755)
- VSTestBridge: note MSTest no longer depends on it on the MTP path
  as of MSTest 4.3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink pushed a commit that referenced this pull request Jul 9, 2026
- AzureFoundry: add DefaultAzureCredential/managed identity auth details
  and required environment variables (PR #9707)
- MSTestTestFramework: new entry documenting the native MTP ITestFramework
  for MSTest introduced by RFC 018 (PRs #9706, #9743, #9748, #9755)
- VSTestBridge: note MSTest no longer depends on it on the MTP path
  as of MSTest 4.3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink pushed a commit that referenced this pull request Jul 9, 2026
PR #9755 (dropping the VSTestBridge dependency on the MTP path) merged after the v4.3.0 tag was published, so the native MTP framework ships in the unreleased 4.4.0, not 4.3. Addresses review feedback on PR #9772.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Evangelink added a commit that referenced this pull request Jul 9, 2026
The CI build (Windows/Linux legs) was already red on main before this PR due
to two undeclared internal API surfaces flagged by RS0051:

- BaseSerializer.ReadFields / WriteListPayload<T> (added by #9774) — the file
  is linked into Microsoft.Testing.Platform and the HangDump, Retry, TrxReport
  and Extensions.MSBuild extensions, so each project's InternalAPI.Unshipped.txt
  needs the declarations.
- PlatformServicesConfigurationAdapter and its members (from #9755) in
  MSTest.TestAdapter, which only surface on the Windows/net462 TFMs the Linux
  analysis build never compiled.

These are unrelated to the source-gen default change but block this PR's
pipeline, so they are fixed here in a separate commit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Evangelink added a commit that referenced this pull request Jul 9, 2026
Complete the #9755 BridgedConfiguration -> PlatformServicesConfigurationAdapter
rename: the old type name still lingered in InternalAPI.Shipped.txt and
referenced a type that no longer exists. The new name was already added to
InternalAPI.Unshipped.txt; drop the three stale shipped entries so the tracked
internal-API surface is accurate.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Evangelink added a commit that referenced this pull request Jul 13, 2026
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

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants