Launch of the VS2010 UnitTests project from Team Team Team TFS2008

I have a Visual Studio 2010 MVC 3 application with project modules. I have a TFS 2008 build definition to create a solution.

In the build agent, I have the following installed

But when I run the build, I get the following error: -

Using "TestToolsTask" task from assembly "c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.ProcessComponents.dll". Task "TestToolsTask" C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /nologo /usestderr /searchpathroot:"c:\TFS\Core\Crime\Binaries\Release" /resultsfileroot:"c:\TFS\Core\Crime\TestResults" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project1.UnitTests.dll" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project2.UnitTests.dll" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project3.UnitTests.dll" /testcontainer:"c:\TFS\Core\Crime\Binaries\Release\\Project4.UnitTests.dll" /publish:"http://server:8080/" /publishbuild:"vstfs:///Build/Build/88124" /teamproject:"Core" /platform:"Any CPU" /flavor:"Release" Invalid switch "/publish". Invalid switch "/publishbuild". Invalid switch "/teamproject". Invalid switch "/platform". Invalid switch "/flavor". For switch syntax, type "MSTest /help" C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1406,5,1406,5): warning : TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'. The previous error was converted to a warning because the task was called with ContinueOnError=true. C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: The "TestToolsTask" task failed unexpectedly. [c:\TFS\Core\Crime\BuildType\TFSBuild.proj] C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: Microsoft.TeamFoundation.Build.Workflow.Activities.UnexpectedExitCodeException: TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'. 

If I run the mstest command directly on the build server via the command line without switches, it works fine. I do not understand why he is trying to add these switches. any idea?

+2
source share
3 answers

To use these keys in MSTest.exe, VS 2010 Premium or Ultimate is required. You can get around this view by simply executing Exec from MSTest using the switches you want, but then you won't see the results just as well in your build.

+2
source

The switches are added because MSTest is trying to publish the test results to the server so that you can see the information in the assembly log in the command line collector, as well as in the cube for reports, etc.

Assuming that you installed Team Explorer 2010 when you installed VS2010 Professional, you should be able to publish test results (unless the license requires a premium class or a maximum - I don’t remember). It might be worth reinstalling and reapplying the service pack to see if this fixes the problem.

0
source

I had a problem with spaces in my dll path. The quotes did not work (perhaps because I missed something obvious?). I did not have VS installed on the machine.

0
source

Source: https://habr.com/ru/post/1499616/


All Articles