dotnet test output missing in .NET Core 2.1.300 RC1
See original GitHub issueIn .NET Core 2.1 RC1 SDK (2.1.300-rc1-008673
), the reason that tests fail is not output to the console anymore. As well as being less useful to the developer, this also appears to break functionality like test output detection in TeamCity.
Steps to reproduce
- Clone
https://github.com/martincostello/missing-test-output-repo
- Run
dotnet test
Expected behavior
The reason for the test’s failure is output to the console (example below achieved by using 2.0.104
in global.json
).
PS C:\Coding\missing-test-output-repo> dotnet test
Build started, please wait...
Build completed.
Test run for C:\Coding\missing-test-output-repo\XUnitTestProject1\bin\Debug\netcoreapp2.0\XUnitTestProject1.dll(.NETCoreApp,Version=v2.0)
Microsoft (R) Test Execution Command Line Tool Version 15.6.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
[xUnit.net 00:00:00.4992229] Discovering: XUnitTestProject1
[xUnit.net 00:00:00.5743060] Discovered: XUnitTestProject1
[xUnit.net 00:00:00.5810979] Starting: XUnitTestProject1
[xUnit.net 00:00:00.7636667] XUnitTestProject1.UnitTest1.Bad_Math [FAIL]
[xUnit.net 00:00:00.7655042] Assert.Equal() Failure
[xUnit.net 00:00:00.7656693] Expected: 2
[xUnit.net 00:00:00.7657361] Actual: 1
[xUnit.net 00:00:00.7671460] Stack Trace:
[xUnit.net 00:00:00.7688282] C:\Coding\missing-test-output-repo\XUnitTestProject1\UnitTest1.cs(17,0): at XUnitTe
stProject1.UnitTest1.Bad_Math()
[xUnit.net 00:00:00.7852434] Finished: XUnitTestProject1
Failed XUnitTestProject1.UnitTest1.Bad_Math
Error Message:
Assert.Equal() Failure
Expected: 2
Actual: 1
Stack Trace:
at XUnitTestProject1.UnitTest1.Bad_Math() in C:\Coding\missing-test-output-repo\XUnitTestProject1\UnitTest1.cs:line 1
7
Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.
Test Run Failed.
Test execution time: 1.8924 Seconds
PS C:\Coding\missing-test-output-repo>
Actual behavior
Reason for the test’s failure is not output, just that the test failed.
PS C:\Coding\missing-test-output-repo> dotnet test
Build started, please wait...
Build completed.
Test run for C:\Coding\missing-test-outputrepo\XUnitTestProject1\bin\Debug\netcoreapp2.0\XUnitTestProject1.dll(.NETCoreApp,Version=v2.0)
Microsoft (R) Test Execution Command Line Tool Version 15.7.0-preview-20180221-13
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
[xUnit.net 00:00:00.7648657] XUnitTestProject1.UnitTest1.Bad_Math [FAIL]
Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.
Test Run Failed.
Test execution time: 1.9199 Seconds
PS C:\Coding\missing-test-output-repo>
Environment data
dotnet --info
output:
PS C:\Coding\missing-test-output-repo> dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.300-rc1-008673
Commit: f5e3ddbe73
Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.300-rc1-008673\
Host (useful for support):
Version: 2.1.0-rc1
Commit: eb9bc92051
.NET Core SDKs installed:
1.0.0 [C:\Program Files\dotnet\sdk]
1.0.1 [C:\Program Files\dotnet\sdk]
1.0.2 [C:\Program Files\dotnet\sdk]
1.0.3 [C:\Program Files\dotnet\sdk]
1.0.4 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.0 [C:\Program Files\dotnet\sdk]
2.0.2 [C:\Program Files\dotnet\sdk]
2.0.3 [C:\Program Files\dotnet\sdk]
2.1.2 [C:\Program Files\dotnet\sdk]
2.1.3 [C:\Program Files\dotnet\sdk]
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.100 [C:\Program Files\dotnet\sdk]
2.1.101 [C:\Program Files\dotnet\sdk]
2.1.102 [C:\Program Files\dotnet\sdk]
2.1.103 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.300-preview1-008174 [C:\Program Files\dotnet\sdk]
2.1.300-preview2-008530 [C:\Program Files\dotnet\sdk]
2.1.300-rc1-008673 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.0-preview2-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.0-rc1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.0-preview2-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.0-rc1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0-preview1-26216-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0-preview2-26406-04 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0-rc1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:9 (9 by maintainers)
Top Results From Across the Web
dotnet test output missing in .NET Core 2.1.300 RC1 #9367
In .NET Core 2.1 RC1 SDK ( 2.1.300-rc1-008673 ), the reason that tests fail is not output to the console anymore.
Read more >asp.net core - dotnet test not creating test results folder
As part of our ASP.NET Core 2.0 build process I have added a dotnet test command which I have added as a Windows...
Read more >Building, Running, and Testing .NET Core and ASP. ...
Now I can just docker run and then pass in "dotnet --info" to find out about dotnet on my Pi. pi@raspberrypi:~ $ docker...
Read more >dotnet test command - .NET CLI
The dotnet test command is used to execute unit tests in a given project.
Read more >NET Core Support in Visual Studio for Mac 7.5 - Matt Ward
Visual Studio for Mac will detect if the development certificate is missing and offer to install it when you run an ASP.NET Core...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting this issue to us @martincostello! I’ve made a fix that will be in 2.1 RTM.
So I finally got TeamCity results by using
--verbosity=normal
instead. Has the default been changed as part of 2.1.300 since preview 1, or is it that’s what was being used before and I just incorrectly interpreted the above as the workaround?