在TFS 2008上运行自动化测试

时间:2009-04-01 13:58:05

标签: tfs msbuild build-automation automated-tests

我们已将TFS设置为在我们办理登机手续时自动构建,但工作正常。

我们的问题是如何让单元测试在服务器上运行?

  1. 我们如何在构建服务器上运行测试?
  2. 我们如何在服务器上自动运行SQL Scripts来构建测试数据库?
  3. 我们是否需要在Build Server上安装Visual Studio?
  4. 我们是否需要客户端上的Visual Studio Test Edition?

2 个答案:

答案 0 :(得分:1)

打开TeamBuildType文件(TFSBuild.proj)。 在那里你会看到如下的评论......

<!--  TEST ARGUMENTS
 If the RunTest property is set to true then the following test arguments will be used to run 
 tests. Tests can be run by specifying one or more test lists and/or one or more test containers.

 To run tests using test lists, add MetaDataFile items and associated TestLists here.  Paths can 
 be server paths or local paths, but server paths relative to the location of this file are highly 
 recommended:

    <MetaDataFile Include="$(BuildProjectFolderPath)/HelloWorld/HelloWorld.vsmdi">
        <TestList>BVT1;BVT2</TestList>
    </MetaDataFile>

 To run tests using test containers, add TestContainer items here:

    <TestContainer Include="$(OutDir)\HelloWorldTests.dll" />
    <TestContainer Include="$(SolutionRoot)\TestProject\WebTest1.webtest" />
    <TestContainer Include="$(SolutionRoot)\TestProject\LoadTest1.loadtest" />

 Use %2a instead of * and %3f instead of ? to prevent expansion before test assemblies are built
-->

答案 1 :(得分:0)

如果要运行NUnit-Tests,则必须设置包含在Build-.proj文件中的MSBuild-Task。如果要运行VS-Integrated Tests,则默认的Build-Script中有预配置的任务。样本在您生成的Build-.proj-File中被注释掉(注释掉)。

您通常可以在构建中运行任何您想要的内容。这只是创建MSBuild-Tasks并将它们集成到现有构建脚本中的问题,该脚本已在多个位置可扩展。描述所有的MSBuild在这里都无法回答。请参阅有关MSBuild的各种Web资源。

您需要安装在Build-Machine上运行测试所需的任何内容。 NUnit for NUnit-Tests,VS Test Edition for Loadtests和Webtests,等等。

您在任何客户端安装的内容对Build-Server不感兴趣。

相关问题