Infer dotnet host to run integration scenarios#8321
Conversation
| <Compile Include="..\Shared\UnitTests\MockEngine.cs" /> | ||
| <Compile Include="..\Shared\UnitTests\MockLogger.cs" /> | ||
| <Compile Include="..\Shared\UnitTests\ObjectModelHelpers.cs" /> | ||
| <Compile Include="..\UnitTests.Shared\EnvironmentProvider.cs" /> |
There was a problem hiding this comment.
nit: just see there is Shared\UnitTests and UnitTests.Shared: what is the difference here?
There was a problem hiding this comment.
Nice catch!
For historical reasons, there is a bunch of code in MSBuild that is compiled into multiple assemblies (sometimes with slightly different ifdefs). That includes test assemblies. However, the reasons for doing this in non-test assemblies (they aren't great reasons but they are reasons) don't really apply for test, so we introduced a shared assembly for test stuff to build that sort of thing once--but didn't move everything.
There was a problem hiding this comment.
Actually it looks like shortly after introducing that assembly, we dropped all references to it (in ~2017).
It's still a good idea.
Fixes #8313
Context
Some of the unit tests are failing when run from VS - caused by the fact that those tests are supposed to execute msbuild and fail to do so due to attempts to interpret the test runner as the dotnet host process
Changes Made
Added helper to infer the proper host to run the msbuild in core
Logic adopted from SDK, with some alternations (removed unnecessary interop, added nullables, some styling fixes)