Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Youssef1313
Copy link
Member

@Youssef1313 Youssef1313 commented Oct 17, 2025

I forgot to draft #51309 after discussion with @nohwnd about more potential issues with the current implementation. So following-up in a new PR as the original PR got merged accidentally.

ContainsBuiltTestSources should return true if and only if:

  • There is an unmatched token that ends with .dll
  • That unmatched token isn't coming after -- which specifies runsettings inline.
  • That unmatched token doesn't start with - (e.g, -dl which is passed down to MSBuild)

For example:

  • If we have dotnet test <options> -- <settings>, the existence of .dll in the <settings> part should have no impact on the choice of vstest.console vs MSBuild.
  • However, if <options> has something that ends with .dll and doesn't start with -, we consider that as a "source" to test.

In other words:

Dotnet test detects if dlls were provided, and it offloads to VSTest.Console directly in that case. In other cases it finds closest csproj or sln, and offloads that to msbuild.

dotnet test my.dll should offload the run to vstest.console.

dotnet test -p:a=my.dll -dl:myDistributedLogger.dll -- MySetting=My.dll should offload to msbuild, even though we use parameter that is known to dotnet test (-p), parameter that is unknown to dotnet test (-dl), but has to propagate to msbuild. And test specific inline runsettings after the --.

NONE of these cases should trigger the offloading to vstest.console.

@Youssef1313 Youssef1313 marked this pull request as ready for review October 17, 2025 11:06
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.

3 participants