Skip to content

Microsoft.Testing.Platform for xUnit #3478

@bradwilson

Description

@bradwilson

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 dotnet test

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 the documentation & support behind the hook. Right now, through a combination of decompilation of Microsoft.Testing.Extensions.VSTestBridge (which we are not using) and inspecting the logs from dotnet test when using that, it appears that dotnet test is utilizing a command line option that looks like --internal-msbuild-node <argument>.

Based on this comment, this is currently an undocumented and unsupported way to get dotnet test to work:

This is the reason why the option starts with --internal-, options that start with it are hidden internal.

So my question is:

When will the interaction between Microsoft.Testing.Platform test frameworks and dotnet test become documented and supported? If this isn't the way we should be doing it, then what is the officially supported way to enable dotnet test for Microsoft.Testing.Platform test framework implementations that are not based on Microsoft.Testing.Extensions.VSTestBridge?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions