简体   繁体   English

使用实验室管理来运行单元/集成测试

[英]Run unit/integration tests with Lab Management

We have a complete Lab Management environment running Coded UI tests in nightly builds. 我们有一个完整的实验室管理环境,它在每晚的版本中运行“编码的UI”测试。 What we are trying to achieve is to run our integration tests (regular TestMethod() with SQL connections) just before all the Coded UI tests to verify that our db scripts are executed correctly and that there are no new changes causing any problems. 我们要实现的目标是,在所有编码的UI测试之前运行集成测试(带有SQL连接的常规TestMethod()),以验证我们的数据库脚本是否正确执行,并且没有新的更改引起任何问题。

So far I have found a way to execute tests remotely through .testrunconfig. 到目前为止,我已经找到了一种通过.testrunco​​nfig远程执行测试的方法。 The problem we have with that approach is that it's not possible to choose a testcontroller connected to a team project so I guess that would be only useful for running tests on physical machines outside of Lab Management? 这种方法的问题在于不可能选择连接到团队项目的测试控制器,因此我想这仅对在实验室管理之外的物理机上运行测试有用吗?

One option seem to be to create a Test Case for each integration test and that should run it together with the UI tests but it feels like it will be to much maintenance managing hundreds of test cases just to run the integration tests. 一种选择似乎是为每个集成测试创建一个测试用例,然后将其与UI测试一起运行,但似乎要进行大量维护才能管理数百个测试用例以运行集成测试。 Also it would be better to completely separate the test runs for the different kinds of tests. 对于不同种类的测试,最好将测试运行完全分开。

Is there any easy way to achieve this that I have totally missed? 有什么简单的方法可以实现我完全错过的目标吗? Or do I have to modify the lab build template to deploy and run the tests? 还是我必须修改实验室构建模板才能部署和运行测试?

I guess that would be only useful for running tests on physical machines outside of Lab Management? 我猜这仅对在实验室管理之外的物理机上运行测试有用吗?

If you run your tests remotely through .testrunconfig you have to connect the Test Agent to another Test Controller which is NOT connected to the team project. 如果通过.testrunconfig远程运行测试,则必须将测试代理连接到另一个未连接到团队项目的测试控制器 Unfortunately it is impossible for the environment which are running under the Lab Management, to my knowledge. 不幸的是,据我所知,在实验室管理下运行的环境是不可能的。

What about this approach: 那么这种方法呢:

  1. Create an Ordered Test containing all you integration tests. 创建一个包含所有集成测试的有序测试。
  2. Create a new Test Case "Integration Tests" and automate it by the ordered test So you do not have to maintain hundreds of Test Cases. 创建一个新的测试用例 “集成测试”,并通过订购的测试将其自动化,因此您不必维护数百个测试用例。 You could also create several Ordered Tests if you want to group the integration tests and then create a "main" Ordered Test containing them. 如果要对集成测试进行分组,然后创建一个包含它们的“主” 有序测试 ,则还可以创建多个有序测试 This way it will be easier to analyze test results especially if you have a lot of tests. 这样,将更容易分析测试结果,尤其是在您进行大量测试的情况下。
  3. Let the integration tests run as a part of your existing nightly build . 集成测试作为您现有的夜间构建的一部分运行。
  4. Create a new Build Definition which does not start a build but uses the last successful nightly build and let your CodedUI tests run using Lab Build Template . 创建一个新的 构建定义 ,该定义不会开始构建,而是使用最近一次成功的每晚构建,并使用Lab Build Template运行您的CodedUI测试。

This way you will have different test runs for the different kinds of tests. 这样,您将针对不同种类的测试进行不同的测试运行。

The only drawback is that you have to "synchronize" these two builds... You could just schedule the second build later so you could be sure the fist build is done. 唯一的缺点是您必须“同步”这两个构建...您可以稍后安排第二个构建,这样就可以确保第一个构建已完成。

It's not really perfect, I know... but this way you could easily achieve your goal. 我知道这并不完美,但是通过这种方式您可以轻松实现目标。

I am not sure if there is an alternative solution, but on the project I am currently working on we have both our Unit and Integration Test Assemblies set under the Process options (Process>Basic>AutomatedTest>TestAssembly) in our Nightly Build. 我不确定是否有其他解决方案,但是在我目前正在处理的项目上,我们在每夜构建中的“处理选项” (“流程”>“基本”>“自动化测试”>“测试组件”)下设置了单元测试和集成测试组件。
This was achieved through altering the Default Build Process Template (not the Lab Default) a bit, as you suggested (I thought this was standard, but it's been a while). 正如您所建议的(我认为这是标准的,但是已经有一段时间了),这是通过稍微更改默认构建过程模板 (不是Lab Default)来实现的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TfsBuild不运行单元测试 - TfsBuild does not run unit tests TestComplete 8和TFS 2010实验室管理 - TestComplete 8 and TFS 2010 Lab Management Microsoft测试管理-如何确定在预定义的实验室环境中要在哪台计算机上运行的测试 - Microsoft Test Management - How to determine which test to run on which machine in predefined lab environment 运行在TFS生成期间失败的单元测试 - Run unit tests which fail during TFS-Build 如何从命令行运行单元测试测试? - How to run unit testing tests from command line? TFS 2010 中的多个构建配置不运行单元测试 - Unit tests aren't run with multiple build configurations in TFS 2010 如何调试TFS实验室管理网络隔离? - How to debug TFS Lab Management Network Isolation? 如何使用持续集成在msTild上打包并在TFS 2010上运行测试 - How to both package with msbuild and run tests on TFS 2010 using Continuous Integration 我想针对多个不同的数据库运行teambuild的单元测试(不止一次) - I want to run teambuild's unit tests (more than once) against multiple different databases 我可以在一台机器上运行TFS Build Controller和单元测试,而在另一台机器上运行TFS Build Agents吗? - Can I run TFS Build Controller and Unit Tests on one machine and TFS Build Agents on another machine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM