Using dotnet.cli plugin tests fail but pass when run from command line

Using 

Team City 2019.1.4 and Visual Studio Testing Framework

Multi targeted dotnet 4.6.1, 4.8 and Core 2.2 projects

My unit tests pass when run directly from the console:

    dotnet test mysolution.sln

But they fail when run through the dotnet.cli plugin.  I notice from the logs that it executes this command line: 

    dotnet.exe test Miruken.AspNet.sln @C:\TeamCity\BuildAgents\BuildAgent03\temp\agentTmp\2.rsp

I tracked the failure down to this line in the rsp file:

/p:VSTestTestAdapterPath=C%3A%5CTeamCity%5CBuildAgents%5CBuildAgent03%5Cplugins%5Cdotnet%2Ecli%5Ctools%5CTeamCity%2EDotnet%2EIntegration%2E1%2E0%2E8%5Cvstest15%3B%2E

If I remove that line tests pass again.

I pulled down the code for the plugin, but having trouble finding where it actually sets ups up and runs the tests.

Some direction is greatly appreciated

 

One theory/question I have is are dll's are being copied and run somewhere different than the bin folder.  We use a DI container and assembly scanning to find implementations.

0
1 comment

Hi Michael,

 

sorry for the delay. Teamcity uses a couple temporary folders (agentTmp and buildTmp) answering your last question. Its usage depends on each build so it's hard to get exactly at it, but they should just be like regular temporary folders, so if your DI containers and scanning keep that in mind it should be fine.

 

I'm not aware that this issue has been reported before. If you can replicate it consistently, we recommend to create a new issue in our tracker detailing the case. Please attach all the build step settings, the build log, all agent logs covering the build, the command you used in the console to run the build and the full console output of the build.

0

Please sign in to leave a comment.