none
Error using Microsoft.TeamFoundation.Build.Workflow.Activities.MSTest

    Question

  • Hello,

    I'm using a template for my Build process, and I used Microsoft.TeamFoundation.Build.Workflow.Activities.MSTest

    I got the follwing error message with all Workflow.Activities.MSTest, eventhough the the command works fine when tested on command Prompt :

    The MSTestActivity was invoked without a value for Platform or Flavor. The values AnyCPU and Debug were used.

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe /nologo ...............

    Exception Message: The directory name is invalid (type Win32Exception) Exception Stack Trace:  Server stack trace:    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)   at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.ProcessWrapper.Start()   at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.InvokeProcessInternal.RunCommand(AsyncState state)   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)   at System.Func`2.EndInvoke(IAsyncResult result)   at System.Activities.AsyncCodeActivity`1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

    Any Help on this..

    Thanks

    Thursday, August 29, 2013 9:01 AM

Answers

  • Hi AmineBz,

    Thanks for your reply.

    Please follow my below example steps:

    1        Copy a DefaultTemplate.11.1.xaml named it CustomDefaultTemplate.11.1xaml, then add this custom file into your team project>>BuildProcessTemplate folder and check-in to TFS Source Control.

    2        Under Source Control Explorer>>your team project>>BuildProcessTemplate folder, double-click CustomDefaultTemplate.11.1xaml file to open it in your VS 2012.

    3        Find the default Run MSTest for Test Assemblies activity and set it ToolPath property value to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE", please refer to the follow screenshots.  

          

         

    4        Edit your build definition to selected the CustomDefaultTemplate.11.1xaml build template, and selected the MSTest.exe Runner(VS 2010 compatible) as Test Runner, please refer to the follow screenshot:(don’t specific the Test settings file, if specific the Test settings file, you also need to set the ToolPath property for another default Run MSTest for Test Assemblies activity, you can refer to the first screenshot)

         

    5        After edited your build definition, then queue build definition and check the result:

         


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 03, 2013 6:35 AM
    Moderator
  • Hi John,

    Thank you for your help..

    I found the problem and solved it..actually the name of my test DLL waqs not matching :

    TestSpecs = Run tests in assemblies matching **\test*.dll

    The error message "Directory not fount.." that I was getting was misleading..

    Amine

    Tuesday, September 03, 2013 12:39 PM

All replies

  • Hi Amine, 

    Thanks for your post.

    You copied which default build process template and tried to edit it?

    If you want invoke VS 2012 MSTest.exe in TFS 2010 default build process template>>Run MSTest for Test Assemblies activity(Microsoft.TeamFoundation.Build.Workfolow.Activities.MSTest), you should open the default build process template and find this activity in build process template, then open the Properties window for this activity, specify the path value in ToolPath property, the path should be “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE”. 

    And in default build process template>>Run Test for Test Assemblies activity, the Flavor property value is platformConfiguration.Configuration, and Platform property value is platformConfiguration.Platform.  

    You should copy the default build process template, then edit this copied build process template achieve what you want.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, August 30, 2013 6:07 AM
    Moderator
  • Hi John,

    Thank you for your reply.

    I did the updates you mentioned on your reply, and I's still getting the same error (see the log below), any other idea..Thanks

    Inputs
    • TestLists:
    • ToolPath: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
    • TestNames:
    • MinPriority: -1
    • TestSettings:
    • CommandLineArguments:
    • SearchPathRoot:
    • Platform: platformConfiguration.Platform
    • MaxPriority: -1
    • Category:
    • RunTitle:
    • PathToResultsFilesRoot:
    • TestContainers: String[] Array
    • TestMetadata:
    • TestConfigName:
    • Flavor: platformConfiguration.Configuration
    • TestConfigId: -1
    • Publish: False

    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe /nologo /usestderr /testcontainer:"E:\Builds\8\190\Binaries\GHX.FitNesse.Fixtures\GHX.FitNesse.Fixtures.dll"

    Exception Message: The directory name is invalid (type Win32Exception) Exception Stack Trace:  Server stack trace:    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)   at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.ProcessWrapper.Start()   at Microsoft.TeamFoundation.Build.Workflow.Activities.InvokeProcess.InvokeProcessInternal.RunCommand(AsyncState state)   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink) Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)   at System.Func`2.EndInvoke(IAsyncResult result)   at System.Activities.AsyncCodeActivity`1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

    Friday, August 30, 2013 8:53 AM
  • Hi Amine,

    Thanks for your reply.

    On your build agent machine, check if MSTest.exe under the path “C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE”, if MSTest.exe existed there, try execute the MSTest.exe command line to build your test project .dll file manually, and ensure you can manually build it correctly.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 02, 2013 3:32 AM
    Moderator
  • Hi John,

    Yes, on my Build agent machine  MSTest.exe  is under that path, and I can run the same command manually on the Build agent server without problem..

    Any other idea what could be the problem?

    Thanks for your help,

    Monday, September 02, 2013 8:09 AM
  • Hi AmineBz, 

    Thanks for your reply.

    What’s the version of your TFS and VS?

    You copied which default build process template to custom?

    If you have any further research of this issue, please share your experience here.


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 02, 2013 10:15 AM
    Moderator
  • Hi John,

    I'm using  TFS 2012,  VS 2012, and the default template is 1.1 that we edited..

    Thanks

    Monday, September 02, 2013 11:53 AM
  • Hi AmineBz,

    Thanks for your reply.

    Please follow my below example steps:

    1        Copy a DefaultTemplate.11.1.xaml named it CustomDefaultTemplate.11.1xaml, then add this custom file into your team project>>BuildProcessTemplate folder and check-in to TFS Source Control.

    2        Under Source Control Explorer>>your team project>>BuildProcessTemplate folder, double-click CustomDefaultTemplate.11.1xaml file to open it in your VS 2012.

    3        Find the default Run MSTest for Test Assemblies activity and set it ToolPath property value to "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE", please refer to the follow screenshots.  

          

         

    4        Edit your build definition to selected the CustomDefaultTemplate.11.1xaml build template, and selected the MSTest.exe Runner(VS 2010 compatible) as Test Runner, please refer to the follow screenshot:(don’t specific the Test settings file, if specific the Test settings file, you also need to set the ToolPath property for another default Run MSTest for Test Assemblies activity, you can refer to the first screenshot)

         

    5        After edited your build definition, then queue build definition and check the result:

         


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, September 03, 2013 6:35 AM
    Moderator
  • Hi John,

    Thank you for your help..

    I found the problem and solved it..actually the name of my test DLL waqs not matching :

    TestSpecs = Run tests in assemblies matching **\test*.dll

    The error message "Directory not fount.." that I was getting was misleading..

    Amine

    Tuesday, September 03, 2013 12:39 PM
  • Hi John,

    I have another question related to the discussion above..I'm trying to use MSTest activity to run my tests using an empty template (it's customized template that compiles my projects and then I run the tests using MSTest activity) for some reason the results don't get published to my build on TFS..However if I insrt mt custom activities in the template 11.1 they work fine..

    can you please help on this..

    Thanks

    Tuesday, September 24, 2013 3:26 PM
  • Hi AmineBz,

    Thanks for your reply.

    You copied which default build process template and customized it to generated your empty template?

    Can you find the detailed error/issue message in your build log? Set Logging Verbosity = Diagnostic in build definition.

    For this scenario, I suggest you to  create a new post which have the detailed description and information about this issue in the forum, our engineers and members will handle it ASAP.

     


    John Qiao [MSFT]
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, September 25, 2013 1:37 AM
    Moderator