microsoft / testfx

MSTest framework and adapter
MIT License
714 stars 253 forks source link

How to officially support Test Explorer with a custom Microsoft.Testing.Platform test framework? #3479

Closed bradwilson closed 1 month ago

bradwilson commented 1 month ago

The approach xUnit.net v3 is taking for supporting Microsoft.Testing.Platform (since it already produces executables) is to conditionally use the "create TestApplication.CreateBuilderAsync and build it" approach when it understands that it's time to run in that way, vs. letting it run with our entry point.

Our current strategy is to:

There are two branches right now that perform this work in concert with one another:

https://github.com/xunit/xunit/tree/microsoft-testing-platform https://github.com/xunit/visualstudio.xunit/tree/microsoft-testing-platform

My question is about enabling support for Test Explorer in this scenario. Based on this comment, it appears that we should be looking for this set of command line options:

VS startup specifies the following flags: ./process.exe --server --client-port %PORT%.

We are currently dispatching to our Microsoft.Testing.Platform test framework implementation when we see --server as the first command line option. Note that we are not using the Microsoft.Testing.Extensions.VSTestBridge NuGet package.

So my question is:

What else do we need to do to ensure that any version of Test Explorer which supports Microsoft.Testing.Platform will consume us via the new APIs? How can we verify when running tests inside Test Explorer whether it's using TPv2 or Microsoft.Testing.Platform? Where does the official documentation of these switches and how to do this integration live?

bradwilson commented 1 month ago

@MarcoRossignoli @drognanar

MarcoRossignoli commented 1 month ago

Discussed here it's not needed at the moment xunit will use the testing framework to plug to the tooling, at least as first step. Discussion https://github.com/microsoft/testfx/issues/3479