使用 NUnit 2.5.x 和 .Net 4.0 进行持续集成/构建

发布于 2024-11-28 16:11:22 字数 707 浏览 3 评论 0原文

好的,这是我当前的设置和目前的问题。我在 Visual Studio 解决方案中拥有越来越多的项目。该解决方案包含大约 15 个项目(或多或少)和一个快速增长的代码库。我意识到在我做到这一点之前我应该​​有一个连续的构建系统设置,但我想永远不会太晚。因此,经过一些研究后,我相信我的完美设置是:

  • NUnit 2.5.x(我们已经与此绑定......所以是必要的)
  • CruiseControl.Net< 集成/code> (对其他选项开放,但仅限支持 Git 的免费选项)
  • 与代码覆盖工具(NCoverDotCover)集成会很好
  • 集成运行 shell命令(对于JSLint 和压缩工具等)

我缺少的是运行自动构建的工具。我查看了 NAnt,但它对运行 MSBuild(构建项目)的支持似乎相当过时(我们使用的是 VS2010)并在构建过程中利用解决方案文件将节省大量时间。我还查看了 MSBuild(出于显而易见的原因),但我发现运行 NUnit 测试的过程仅支持 2.4.x(MSBuild 扩展项目)。

我很好奇其他人是如何组织他们的持续构建系统的。 NUnit 如果相当流行,那么我一定不是唯一对此感到好奇的人。

Ok, so here's my current setup and my problem at the moment. I have a growing set of projects in a Visual Studio solution. The solution contains about 15 projects (give or take a few) and a quickly growing code-base. I realize that I should have had a continuous build system set-up before I got to this, but its never too late I suppose. So after doing a little research, I believe that my perfect setup would be:

  • NUnit 2.5.x (we are already tied to this... so a necessity)
  • Integration with CruiseControl.Net (open to other options, but only free ones with Git support)
  • Integration with a code-coverage tool (NCover, DotCover) would be nice
  • Integration to run shell commands (for JSLint and compression tools, etc.)

What I am missing is a tool to run the automated build. I looked at NAnt, but it's support for running MSBuild (to build the project) seemed fairly outdated (we're using VS2010) and utilizing the solution files in our build process would be a HUGE time saver. I also looked at MSBuild (for the obvious reasons) but the process that I found for running NUnit tests only supports 2.4.x (MSBuild extensions project).

I am curious how everyone else has organized their continuous build systems. NUnit if fairly popular, so I must not be the only one who is wondering about this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无边思念无边月 2024-12-05 16:11:22

我的第一个问题是您将如何建设项目?

Teamcity Professional 免费,每台服务器有 20 种构建配置,将使您的就像如此简单得多,内置了 dotcover,并且非常容易设置、运行测试等,而且它是迄今为止最完善的 CI 服务器。

Jenkins 是下一个亚军,它是 Hudson 的一个分支,并且具有非常灵活的插件
可以做任何事情,使其比 Teamcity 更灵活,但设置起来并不容易,代码覆盖设置起来很痛苦,并且有一些烦人的怪癖,但它是完全免费的。

除非您有非常充分的理由使用 CruiseControl.Net,否则不要打扰,因为当时它非常强大,但遗憾的是它现在已经过时并且使用起来很痛苦。

就设置构建而言,Teamcity 和 Jenkins 都支持 MSBuild、NAnt、Rake 等。它们还支持多个构建步骤,就像在 msbuild 或 Nant 文件中一样。我过去所做的只是使用 .sln 文件通过一个构建步骤进行构建,使用构建任务进行单元测试,然后使用内置任务进行代码覆盖,然后使用另一个构建任务来推送文件。

我使用过 TeamCity、Jenkins、TFS,并且尝试使用 CruiseControl.Net,但发现它非常笨重。到目前为止,Teamcity 是最好的,Jenkins 紧随其后,即使我有 TFS,我也不愿意使用它。

如果您有任何疑问,请随时与我联系。

my first question is how may build projects will you have?

Teamcity Professional is free for 20 build configurations per server and will make your like sooooo much easier, has dotcover build in, and is really easy to setup, run your tests, etc. and it's by far the most fully baked CI server out there.

Jenkins is the next runner up, it's a fork of Hudson and is very flexible with plugins
to do just about anything making it a little more flexible then Teamcity but it's not as easy to set up, code coverage is a pain to set up and has some annoying quirks, but is completely free.

unless you have some really strong reason to use CruiseControl.Net, don't bother, for it's time it was very powerful but it's now sadly out dated and painful to use.

As far as setting up builds, both Teamcity and Jenkins support MSBuild, NAnt, Rake, etc. they also support multiple build steps like would do in an msbuild or Nant file. What I have done in the past is just use the .sln file to do the build with one build step, used the build in task for unit tests, then used the built in task for code coverage then used a another build task for pushing the files.

I have used TeamCity, Jenkins, TFS, and I tried to used CruiseControl.Net but found it painfully clunky. By far Teamcity is the best, with Jenkins a close second, I would not willing use TFS even if I had it.

If you have any questions please feel free to contact me.

清风疏影 2024-12-05 16:11:22

您可以使用 NAnt 构建 Visual Studio 2010 解决方案。我一直这样做。我在此处的答案中提供了示例 NAnt 脚本: 任务或带有 NAnt 的 msbuild.exe?

You can use NAnt to build your Visual Studio 2010 solutions. I do it all the time. I provided sample NAnt script in my answer here: <msbuild> task or msbuild.exe with NAnt?

江湖彼岸 2024-12-05 16:11:22

如果您需要的只是编译和运行测试,那么 TeamCity 不会出错,它拥有强大的支持用于 NUnit/VS 和一堆内置报告。

如果您需要运行更复杂的构建脚本,我建议您使用 FinalBuilder 用于创建构建脚本和 TeamCity 命令运行程序来执行该脚本。
通过将测试结果导入 TeamCity,您仍然可以获得报告,并且有一种简单的方法可以将构建状态从 FinalBuilder 输出到 TeamCity:

If all you need is compile and run tests you can't go wrong with TeamCity it has great support for NUnit/VS and a bunch of reports built in.

If you need to run a more complex build script I suggest you use FinalBuilder for creating the build script and TeamCity command runner to execute that script.
By importing the test result into TeamCity you can still get the reports and there is a simple way to output build status from FinalBuilder to TeamCity:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文