Closed wattsm closed 4 years ago
xunit tests for .net core only sends tests statistics to TeamCity via service messages without any additional adapters, so you could avoid passing /Logger:TeamCity "/TestAdapterPath:C:\TeamCity\Agent.1\buildAgent\work\6cbcd640b5d0f18b\build\work"
there
But there is an issue, so you should use the verbosity level at least normal
adding the argument /logger:console;verbosity=normal
like the following:
"C:\Program Files\dotnet\dotnet.EXE" vstest "C:\TeamCity\Agent.1\buildAgent\work\6cbcd640b5d0f18b\build\work\Test.Assembly.dll" /logger:console;verbosity=normal
Or you could update the TeamCity version and dotnet CLI runner will do it for you
I've update the readme file
Thanks @NikolayPianikov, removing the Team City logger from dotnet vstest
has done the trick.
To clarify, when you say that .Net Core Xunit tests send statistics without any additional adapters, does this mean that they also do not require a reference to TeamCity.VSTest.TestAdapter
in the test project?
@wattsm Yes, you could remove that reference if you are planning to have dotnet core xunit test projects only. For instance xunit for full dotnet does not provide TeamCity integration from the box.
Sounds good, thanks.
We are running xUnit tests using
dotnet vstest
as a part of our build process. The tests are being run by the agent but the results are not being reported. Looking at the raw agent logs it seems that no system messages are being emited.However, I can log onto the build agent's machine as the user that the agent runs as, copy and paste the
dotnet vstest
command intocmd.exe
and it will run the tests and emit system messages as expected.Any suggestions on what is wrong in our setup gratefully received.
Team City version: TeamCity 2017.1.2 (build 46812)
Example DotNet command being used:
(I have tried running this command as the agent user in
cmd.exe
from various working directories and it always works as expected.)Output of
dotnet --info
: