Skip to content
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

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

Closed
bradwilson opened this issue Aug 5, 2024 · 2 comments

Comments

@bradwilson
Copy link

bradwilson commented Aug 5, 2024

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:

  • Link all v3 test projects against Microsoft.Testing.Platform and Microsoft.Testing.Platform.MSBuild
  • Set a NuGet package variable via .props file inside the xunit.v3.core NuGet package to indicate that a v3 test project is in place
  • Ship a (not linked by default) DLL (xunit.v3.runner.testingplatform) inside our xunit.v3.core NuGet package that has all the Microsoft.Testing.Platform logic
  • Detect from within xunit.runner.visualstudio when it's got a v3 test project, and override the entry point to conditionally dispatch to the code inside xunit.v3.runner.testingplatform when it realizes that we're being asked to run inside of Test Explorer

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
Copy link
Author

@MarcoRossignoli
Copy link
Contributor

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 #3479

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

No branches or pull requests

2 participants