2

I need to run Visual Studio Load test from TFS using command line. I have following setup - 1.Visual Studio 2015 Enterprise 2.TFS 2015 Update 3 3.Developer Command Prompt for VS2015

I am able to run locally by opening Developer Command Prompt and using commandline /TestContainer:Loadtest.loadtest. However, i'm not able to do the same in TFS build.

Can you please tell me what I should type in "Tool" and "Argument" fields for command line step?

shenQA
  • 39
  • 1
  • 8

1 Answers1

0

Local VS is also using MSTest.exe command to run the Load test.

To run the loadtest in vNext build, you should also use the command line task and call MSTest.exe command in the build agent.

  • Tool: You can specify a fully qualified path of MSTest.exe command
  • Argument: Specify arguments to pass to the tool. Such as /testcontainer:[ file name ]

Below is the snapshot from VNext for your reference:

enter image description here

Note: You need to use Test Controller/Test Agents 2013 Update 5 to run load tests on-premises according to this document.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks very much. Could you please tell me if it is possible to publish results in TFS? If yes, how? – shenQA Nov 21 '17 at 09:21
  • @shenQA As far as I know, the load test result data will save to the loadtest database, not sure if it will generated a `.trx` file or not. If there are, then you could use the [Publish Test Results](https://learn.microsoft.com/en-us/vsts/build-release/tasks/test/publish-test-results) task in this case. – PatrickLu-MSFT Nov 21 '17 at 09:55
  • It generates .trx file. I have tried using mstest /TestContainer:"C:\WebAndLoadTestProject1\WebAndLoadTestProject1\LoadTest2.loadtest" /teamproject:"Project Name" /publishbuild:"$(Build.BuildNumber)" /publish:url /flavor:debug /platform:"Any CPU". But I get an error saying -'Build not found under project xyz'. Any idea? – shenQA Nov 23 '17 at 16:24
  • Also Publish Test Results task doesn't work for load test result using mstest. – shenQA Nov 23 '17 at 16:26
  • Hi @shenQA Did you just publish test result failed or the build also failed? the /publish /publishid /https://msdn.microsoft.com/en-us/library/ms243151(v=vs.120).aspx#/publish is work with the old XAML build, not the new vNext one. If you use Publish Test Results task not work, what's the error message you got? – PatrickLu-MSFT Nov 24 '17 at 10:05