如何在TFS构建服务器中使用模板运行NUnit测试 [英] How to run NUnit tests using a template in TFS build server

查看:73
本文介绍了如何在TFS构建服务器中使用模板运行NUnit测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用TFS Server 2010中的工作流模板运行nUnit测试.

I need to run nUnit tests using a workflow template in TFS Server 2010.

我发现以下所有参考资料都说明了如何配置Build服务器:

I found all the reference bellow explaning how to configure the Build server:

  • http://morten.lyhr.dk/2008/05/using-nunit-and-ncover-with-tfs-build.html
  • How to run nunit with msbuild from VS2010
  • http://www.codewrecks.com/blog/index.php/2009/07/19/integrate-nunit-test-into-a-tfs-build/
  • http://msdn.microsoft.com/en-us/library/ee342461.aspx

同胞最接近我的需求:

  • https://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20nUnit%20build%20activity

但是我需要的答案是下面的问题:

But the answer I need is for the question bellow:

如何设置包含所有nUnit测试的变量,以及如何为每个循环配置a来运行所有测试"

我确实可以运行所有构建,但是最后,它没有运行任何nUnit测试.

I do get all my build to run, but in the end, it does not run any nUnit test.

但是我应该使用哪个工具来运行nUnit测试?:

But which tool should I use to run the nUnit tests?:

如果您对使用TFS 2010完成该操作有任何建议,请告诉我.

Please let me know if you have any advice on how to get it done using the TFS 2010.

非常感谢您.

推荐答案

帖子•

The post •https://tfsbuildextensions.codeplex.com/wikipage?title=How%20to%20integrate%20the%20nUnit%20build%20activity gives all the steps required to make use of this community TFS extensions. It is meant to be a step by step to get the activity working

注释的第1步显示了如何查找所有已构建的程序集,基本上是扫描a来查找任何以* .dll结尾的文件.我认为这是您提出问题的关键,您只需传递构建生成的所有DLL的列表,然后让nUnit查找测试.如果您想做其他事情,则可以按任何方式构建DLL列表,但是扫描似乎是最简单的,您不必担心自己管理列表

Step 1 of the notes shows how to find all the assemblies that have been built, basically scan a for any file ending *.dll. I think this is the key to your question, you just pass a list of all DLLs produced by the build and let nUnit find the tests. If you want to do something else you can build the list of DLLs any way you want, but a scan seems the most simple, you don't have to worry over managing the list ypourself

第2a步运行nUnit测试,将DLL列表传递到nUnit活动中(实际上是命令行测试运行程序).这将在每个DLL中查找nUnit属性并运行找到的测试.

Step 2a runs the nUnit test, the list of DLLs is passed into the nUnit activity (in effect the command line test runner). This will look in each DLL for the nUnit attributes and run the tests it finds.

步骤2b将结果发布回TFS.这是通过获取测试运行程序的XML输出并将其与MSTEST一起发布到TFS服务器来完成的.

Step 2b publishes the results back to TFS. This is done by taking the XML output of the test runer and publishing it with MSTEST to the TFS server.

如果您使用的是TFS 2012或更高版本,则我不会使用此活动,而是使用TFS中内置的新测试适配器模型 http: //blogs.blackmarble.co.uk/blogs/rfennell/post/2012/03/27/Unit-testing-in-VS11Beta-and-getting-yours-tests-run-on-the-new-TFSPreview- build-service.aspx http://visualstudiogallery. msdn.microsoft.com/c8164c71-0836-4471-80ce-633383031099/

If you are using TFS 2012 or later I would not use this activity, I would use the new test adaptor model built into TFS http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/03/27/Unit-testing-in-VS11Beta-and-getting-your-tests-to-run-on-the-new-TFSPreview-build-service.aspx and http://visualstudiogallery.msdn.microsoft.com/c8164c71-0836-4471-80ce-633383031099/

这篇关于如何在TFS构建服务器中使用模板运行NUnit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆