你如何运行詹金斯NUnit的测试? [英] How do you run NUnit tests from Jenkins?

查看:126
本文介绍了你如何运行詹金斯NUnit的测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在找一个C#应用程序运行自动化测试的NUnit,夜间和每次提交到SVN。

这是一些詹金斯-CI可以做?

是否有一个在线教程或如何对文件,它记录了类似的设置,我可以看看?


解决方案

我需要做的正是你做什么,这里是我的设置詹金斯如何做到这一点:


  1. 添加NUnit的插件詹金斯

  2. 在您的项目转至配置 - > 建立 - > 添加构建步骤

  3. 在下拉向下滚动到 - > 执行Windows批处理命令

  4. 确保这一步放在你的MSBuild步骤后

  5. 添加以下,替换变量:

单个DLL测试:


  

[PathToNUnit] \\ BIN \\ NUnit的-console.exe [PathToTestDll] \\ Selenium.Tests.dll
  /xml=nunit-result.xml


多使用DLL测试 NUnit测试项目的:


  

[PathToNUnit] \\ BIN \\ NUnit的-console.exe [PathToTests] \\ Selenium.Tests.nunit
  /xml=nunit-result.xml



  1. 生成后操作,剔发布NUnit测试结果报告

  2. 对于文本框的测试报告XML的,输入的 NUnit的,为result.xml

在你的项目已经建成,NUnit现在运行,其结果将是可见无论是在仪表盘(如果你将鼠标悬停在天气报告图标)或者根据项目页面上的最后测试结果

您也可以从Visual Studio中或作为您当地的构建过程中运行命令。

下面是我用两个参考的博客文章。我没有找到任何适合我的要求完全相同:

<一href=\"http://ferritedog.word$p$pss.com/2011/05/27/1-hour-guide-to-continuous-integration-setup-jenkins-meets-net/\">1-Hour引导持续集成设置:詹金斯会见净(2011)

指南建立使用哈德森 .NET项目(2008年)

I'm looking to run automated NUnit tests for a C# application, nightly and on each commit to svn.

Is this something that Jenkins-CI can do?
Is there an online tutorial or how-to document which documents a similar setup that I can look at?

解决方案

I needed to do exactly what you do, here's how I setup Jenkins to do this:

  1. Add the NUnit Plugin to Jenkins
  2. In your project go to Configure -> Build -> Add a build step
  3. In the dropdown scroll down to -> Execute Windows Batch Command
  4. Ensure this step is placed after your MSBuild step
  5. Add the following, replacing the variables:

Single dll test:

[PathToNUnit]\bin\nunit-console.exe [PathToTestDll]\Selenium.Tests.dll /xml=nunit-result.xml

Multiple dll test using NUnit test projects:

[PathToNUnit]\bin\nunit-console.exe [PathToTests]\Selenium.Tests.nunit /xml=nunit-result.xml

  1. Under Post-build Actions, tick Publish NUnit test result report
  2. For the textbox Test report XMLs, enter nunit-result.xml

Once you project has been built, NUNit will now run and the results will be viewable either on the Dashboard(if you hover over the Weather report icon) or on the project page under Last Test Result.

You could also run the command from within Visual Studio or as part of you local build process.

Here's two blog posts I used for reference. I didn't find any that fitted my requirements exactly:
1-Hour Guide to Continuous Integration Setup: Jenkins meets .Net (2011)
Guide to building .NET projects using Hudson (2008)

这篇关于你如何运行詹金斯NUnit的测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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