dotnet test build step is outputting "Error code 1" instead of test passed/failed counts in project screen

TeamCity Enterprise 2017.1.1 (build 46654)

Have a configuration with one step, 

1.
.NET Core (dotnet) 
dotnet test  /dir1/dir2/TestAssembly.csproj
Execute: If all previous steps finished successfully

we are using .NET Core version 1.1

If one or more tests fail within the assembly, the project screen shows "Error Code 1" instead of the passed/failed count as you would expect.

but if you look in the build log, you do see the correct output:

[12:29:29][Step 1/1] Debug Trace:
[12:29:29][Step 1/1] DEFAULT_APPNAME Information: 0 : 2017-08-14 13:29:26.694 -04:00 [Information] Starting Unit Test
[12:29:29][Step 1/1]
[12:29:32][Step 1/1]
[12:29:32][Step 1/1] Total tests: 52. Passed: 51. Failed: 1. Skipped: 0.
[12:29:32][Step 1/1] Test Run Failed.
[12:29:32][Step 1/1] Test execution time: 16.9202 Seconds
[12:29:32][Step 1/1]
[12:29:32][Step 1/1]
[12:29:32][Step 1/1] Process exited with code 1
[12:29:34][Step 1/1] Process exited with code 1
[12:29:32][Step 1/1] Step .NET Core (dotnet) failed
 
 
Any ideas on why this is not displaying the correct information on the project screen?
 
Thank you.

 

0
3 comments

Hi,

You can use this https://github.com/JetBrains/TeamCity.VSTest.TestAdapter to get test statistics for .net core. Could you give it a try and see whether it works for you?

0
Avatar
Permanently deleted user

Thank you for the suggestion.

However, another test configuration on the SAME agent returns the correct output and both are configured exactly the same (except for a different test project).

So it would seem that the agent CAN produce the right result in some cases but not others.  Do you still think the adapter would correct this issue?

 

0

Being the same agent is not as relevant as being different configurations. Can you share screenshots of how have you configured them and the build steps?

0

Please sign in to leave a comment.