-
Notifications
You must be signed in to change notification settings - Fork 341
Description
Description
In the .NET SDK 2.1.300, MSBuild on .NET Core will introduce support for node reuse. This feature enable faster cycle times by keeping MSBuild worker processes alive after the first build ends, allowing them to be reused "hot" by the second and subsequent builds.
Unfortunately, this is incompatible with the output strategy used by VSTestTask, which depends on child processes of MSBuild being attached to the stdout stream of the entry-point dotnet test
process. That can't be the case when vstest.console
may be run from an MSBuild that has no stdout stream.
On a CLI with the new MSBuild, output from VSTest does not appear on the console.
Steps to reproduce
This is the root cause of the test failures in https://ci.dot.net/job/dotnet_cli/job/release_2.1.2xx/job/release_windows_nt_x64_prtest/41/
On a CLI with the new MSBuild, run dotnet test
.
Expected behavior
Test output is displayed from dotnet test
regardless of MSBuild internals. From preview1:
s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti>"C:\Program Files\dotnet\dotnet.exe" test
Build started, please wait...
Build completed.
Test run for s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti\bin\Debug\net46\VSTestDesktopAndNetCore.dll(.NETFramework,Version=v4.6)
Microsoft (R) Test Execution Command Line Tool Version 15.6.0-preview-20180109-01
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Failed VSTestFailTest
Error Message:
Assert.Fail failed.
Stack Trace:
at TestNamespace.VSTestTests.VSTestFailTest()
Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.
Test Run Failed.
Test execution time: 1.8794 Seconds
Test run for s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti\bin\Debug\netcoreapp2.1\VSTestDesktopAndNetCore.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 15.6.0-preview-20180109-01
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Failed VSTestFailTest
Error Message:
Assert.Fail failed.
Stack Trace:
at TestNamespace.VSTestTests.VSTestFailTest() in s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti\Tests.cs:line 19
Failed VSTestFailTestNetCoreApp
Error Message:
Assert.Fail failed.
Stack Trace:
at TestNamespace.VSTestTests.VSTestFailTestNetCoreApp() in s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti\Tests.cs:line 31
Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.
Test Run Failed.
Test execution time: 1.7366 Seconds
s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti>
Actual behavior
Test output from dotnet test
is lost; the build fails without error.
s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti>dotnet test
Build started, please wait...
Build completed.
s:\cli\bin\3\win-x64\test\dotnet-test.Tests\1\VSTestMulti>