Update Microsoft.Net.Test.Sdk version - #44442
Conversation
|
Found the following netcoreapp3.1 test failures with the new test SDK and not with the older version: I see the following test failures in net472: The net472 failure seems simple to fix, but not sure about the netcoreapp3.1 failures. Also, why would the tests have different behavior in the VS test runner compared to Test.cmd or in CI? Wondering if you have any thoughts on where to start investigating this difference @shyamnamboodiripad @nohwnd? |
|
@RikkiGibson Thanks for the ping. I am not sure why those would only start repro-ing after the SDK update. @nohwnd would probably know. Also tagging @AbhitejJohn to see if he has insights. |
|
Those could be related to the presence of a laucnhsettings.json here. Do we still need that if we we are running these tests with vstest.console/TP? |
True it's easy to fix but I want to understand what changed here? How can updating this package cause our tests to fail? |
|
Missed this notification, did you manage to fix it? When test host fails to locate hostpolicy it is usually because the runtime is not on the system. 16.3.0 started running tests in their correct bitness and this uncovered missing dependencies, because often the host system is missing x86 runtime. But the error message mentions 'C:\Program Files\dotnet' so missing 32-bit was probably not the problem. |
|
Not yet, will revisit this within a few weeks. It still feels wrong that the tests pass on command line but fail in the IDE. Surely the console runner is running the tests with correct bitness. |
|
@nohwnd Have been looking into this more and found that the tests in question work in 16.2.0 but break in 16.3.0. |
|
I think the description of the problem here was a little unclear because I did not specify that we use the Xunit runner in CI. We get the test failures when using 'dotnet test' as well as in Test Explorer. |
|
We started multitargetting .NET Framework in 16.8 you might want to update to that version 16.8.0-preview-20200812-03 https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/16.8.0-preview-20200812-03 As for the original error with netcoreapp3.1 is because in between 16.2.0 and 16.3.0 there was a big change which changed how tests are executed. Before that it would not respect the architecture (x86/x64) and would simply use the dotnet you were currently running. There were also few bugs regarding the resolve of dotnet SDK, which in this case ended up resolving to C:\Program Files\dotnet, where you don't have any runtime (based on the message), while before it would resolve to C:\Program Files (x86)\dotnet\ based on the path of the 32-bit dotnet.exe that was running the tests. |
|
|
|
@sharwell can u elaborate a bit on what broke and why? |
|
I wasn't able to run all tests successfully using |
|
@jaredpar support for netstandard1.x and netcoreapp1.x was completely removed |
|
@RikkiGibson could you share the errors? Maybe I saw them somewhere already. |
|
Superseded by #48817 |
Thanks to @nohwnd for following up with me about this 😄
There have been improvements to the test SDK that we have not been utilizing, such as improved behavior around Debug.Assert in .NET Core. Instead of crashing the test process we now just fail the single test. I know you mentioned this recently @gafter.