Follow-up to dotnet test parsing #51331
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
ContainsBuiltTestSourcesshould return true if and only if:.dll--which specifies runsettings inline.-(e.g,-dlwhich is passed down to MSBuild)For example:
dotnet test <options> -- <settings>, the existence of .dll in the<settings>part should have no impact on the choice of vstest.console vs MSBuild.<options>has something that ends with.dlland 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.dllshould 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.