Skip to content

Delete deadcode in VSTestBridge#7197

Merged
Youssef1313 merged 2 commits intomainfrom
dev/ygerges/deadcode-vstestbridge
Jan 12, 2026
Merged

Delete deadcode in VSTestBridge#7197
Youssef1313 merged 2 commits intomainfrom
dev/ygerges/deadcode-vstestbridge

Conversation

@Youssef1313
Copy link
Copy Markdown
Member

ExecuteRequestAsync(ExecuteRequestContext) is ONLY ever called by core MTP. Core MTP never passes VSTestDiscoverTestExecutionRequest or VSTestRunTestExecutionRequest.

The flow currently goes like:

  • MTP calls ExecuteRequestAsync(ExecuteRequestContext), where the request is either DiscoverTestExecutionRequest or RunTestExecutionRequest
  • In the bridge, we always get to the TestExecutionRequest branch of the switch, and call ExecuteRequestAsync(TestExecutionRequest,IMessageBus,CancellationToken).
  • ExecuteRequestAsync(TestExecutionRequest,IMessageBus,CancellationToken) is abstract and is overridden by SynchronizedSingleSessionVSTestBridgedTestFramework. The implementation of the override handles DiscoverTestExecutionRequest and RunTestExecutionRequest by transforming them to VSTestDiscoverTestExecutionRequest and VSTestRunTestExecutionRequest and then calls either SynchronizedDiscoverTestsAsync or SynchronizedRunTestsAsync
  • SynchronizedDiscoverTestsAsync and SynchronizedRunTestsAsync are abstract and are implementable by frameworks outside the bridge (e.g, MSTest, NUnit, Expecto). Those methods take the concrete VSTestDiscoverTestExecutionRequest and VSTestRunTestExecutionRequest as parameters.

Additional cleanup that can be done but is breaking change:

  • VSTestDiscoverTestExecutionRequest and VSTestRunTestExecutionRequest don't need to inherit DiscoverTestExecutionRequest and RunTestExecutionRequest. In fact, I tend to think that MTP should have made DiscoverTestExecutionRequest and RunTestExecutionRequest sealed.
  • The methods DiscoverTestsAsync and RunTestsAsync implemented in SynchronizedSingleSessionVSTestBridgedTestFramework are dead and are never called.

@Youssef1313 Youssef1313 merged commit b31bcc6 into main Jan 12, 2026
10 checks passed
@Youssef1313 Youssef1313 deleted the dev/ygerges/deadcode-vstestbridge branch January 12, 2026 07:55
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.

2 participants