问题描述
我们有一个 Visual Studio 测试控制器,在特定的测试环境设置中包含 3 个注册的测试代理,用于我们的夜间自动化运行.我已经看到关于让构建代理运行测试的大量文档,但我们需要测试执行通过控制器并从测试代理运行.
We have a Visual Studio test controller with 3 registered test agents in a specific test environment setup for our nightly automation runs. I've seen ample documentation on having the build agents run the tests, but we need the test execution to go through the controller and run from the test agents instead.
我的想法是编辑构建过程模板,这样它会触发这些远程执行的测试的执行,然后等待测试运行结果,但我没有构建模板的经验,我一直找不到任何示例展示我如何做到这一点.当然,这首先假设编辑构建过程是最佳/正确的解决方案.
My thought was to edit the build process template so it would trigger the execution of these remotely executed tests and then wait for the test run results, but I have no experience with build templates and I've been unable to find any examples showing how I might accomplish this. And this is of course assuming that editing the build process is the best/correct solution in the first place.
有在构建/部署周期结束时触发远程测试执行经验的人能否为我指明正确的方向?
Can someone with experience with triggering remote execution of tests at the end of a build/deploy cycle point me in the right direction please?
推荐答案
实际上,您不必对模板进行任何更改.只需确保您的构建定义引用了为远程执行配置的正确测试和测试设置文件.
Actually, you don'have to change anything to your template. Just make sure your build definition refers to the correct tests and testsettings file that are configured for remote execution.
第 1 步:请打开 http://msdn.microsoft.com/en-us/library/ee256991.aspx 并向下滚动到将远程执行或数据收集的测试设置添加到您的解决方案"部分.按照此创建用于远程执行的测试设置文件.
Step 1:Please open http://msdn.microsoft.com/en-us/library/ee256991.aspx and scroll down to the section "Add a test settings for remote execution or data collection to your solution". Follow this to create a test settings file for remote execution.
第 2 步:编辑您的构建定义:转到 Process 页面,在标题2. Basic"下,单击末尾的..."打开Automated Tests"对话框.在自动测试对话框中,单击添加".然后浏览您的测试设置文件(用于远程执行,您刚刚创建的文件)并确认您的选择.
Step 2:Edit your build definition: go to the Process page, under heading "2. Basic", open the Automated Tests dialog by clicking the "..."at the end. It the Automated Tests dialog, click "Add". Then browse for your test settings file (for remote execution, the one you just created) and confirm your choices.
现在保存您的构建定义并将您的构建排入队列.自动地,您的测试现在在远程系统上执行,因为您的 testsettings 文件告诉您的构建系统这样做.
Now save your build definition and queue your build. Automagically, your tests are now performed on the remote system, because your testsettings file tells your build system to do so.
希望这足以让您的远程测试开始工作.
Hope that is enough to start your remote tests to work.
这篇关于如何配置 TFS 构建过程以通过测试控制器在测试代理上执行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!