1
votes

I'm trying to make sense of how to use TFS to run unit tests in remote agents using the new configuration files. What I'm looking for:

  • Have TFS build the code in a build agent
  • The build agent executes unit tests in a remote agent (not the same server as TFS or the build agent)
  • Collecting the test results file (*.trx) in the TFS build agent that triggered the test
  • Do this in the VS 2012/2013 way

So far I have:

  • A test controller and agent properly setup (the controller is not associated with TFS)
  • A .testsettings file in my repository with execution method set to Remote Execution in my test controller
  • TFS building and executing the tests remotely using my .testsettings file
  • Tests successfully running on the remote agent

Where I'm lost:

  • How do I get the .trx file back to my build agent? I see the results successfully published in TFS, but in my build agent's working directory the "tst" directory is empty. If I have the tests running on the build agent I get the trx file here

  • By reading this page, I get the idea that starting with VS2012 we should use a .runsettings file instead. However I can't find a lot of documentation on this and can't see how to configure remote execution there

Could someone give some advice here? I feel I'm lost between different ways to get this done.

Thanks

1
It not completely clear what you are trying to achieve: if you are using the Default Template test execution, you don't need to do anything special. If you want to execute tests after building, you have to use the LabManagement template (aka Build-Deploy-Test). If you are executing tests in some other way (e.g. on a *nix machine), then you have to customize the process to import them, which is well documented.Giulio Vian
OK, apologies for the unclear question. I'm successfully executing the tests in a remote test agent. But I can't get the resulting .trx file anywhere. Not on the agent machine and not on the build agent either. Although I see the test results if I open the build in TFS or VS. I'm using the default template where I specify the .testsettings to use and the assembly pattern to match.Pedro

1 Answers

0
votes

TFS is able to import file in TRX format. An overview of the process is described in http://blogs.msdn.com/b/visualstudioalm/archive/2012/12/06/publishing-test-results-through-command-line-test-runner.aspx, while the documentation page with the details of MSTest.exe are in http://msdn.microsoft.com/en-us/library/ms243151.aspx.