如何在并行运行MSpec试件? [英] How do I run MSpec test assemblies in parallel?

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

问题描述

我们有以下设置:


  • 团队市V8.1.2

  • .NET 2013我们的测试解决方案,与几个不同的C#项目(ASP.NET MVC中,
    库,测试项目等。)

  • 95%是MSpec,但我们也有一些NUnit的测试

  • 我们有14个项目的测试和不断增长的...

  • Team City v8.1.2
  • .NET 2013 Solution with several different C# projects (ASP.NET MVC, libraries, testing projects, etc.)
  • 95% of our tests are MSpec, but we also have some NUnit tests.
  • We have 14 test projects and growing...

目前的测试阶段同时,大约9分钟MSpec测试和1分钟NUnit的。我们想启动这个并行,如我们预期的测试的数量快速增长。什么是最好的解决办法,但前提是:

Currently the testing phase is taking, roughly, 9 minutes for MSpec tests and 1 minute for NUnit. We would like to start parallelizing this, as we expect the number of tests to grow quickly. What would be the best solution, provided that:


  • MSpec似乎没有任何并行亚军

  • 测试应该每个装配并行化,测试在同一组件内连续运行。

  • 的并行不应影响我们如何显示生成结果。我们仍然希望一切聚集,因为它是现在。

  • 不应该存在与开发商机的本地执行的任何摩擦。这将需要的是,无论是安装,不会使本地运行我们的测试更为复杂。如果解决方案,不管它是什么,让我们并行本地运行的测试,那将是巨大的。

  • 我们喜欢的,而不是规模利用的每个构建代理的并行能力,在多个代理上运行,因为我们每个代理支付。

  • MSpec doesn't seem to have any parallel runner.
  • The tests should be parallelized per assembly, which tests running sequentially within the same assembly.
  • The parallelization shouldn't affect how we display the build results. We still want everything aggregated as it is right now.
  • There shouldn't be any friction with the local execution in developers' machine. It would be required that, whatever the setup is, doesn't make running our tests locally more complicated. If the solution, whatever it is, allows us running the tests locally in parallel, that would be great.
  • We prefer to scale making use of the parallel capabilities of each build agent, instead of running on multiple agents, because we pay per agent.

推荐答案

要并行运行MSpec测试与TeamCity的你可以使用 mspec-TeamCity的-prunner.exe ,这是一个下拉更换为标准MSpec亚军。

To run MSpec tests in parallel with TeamCity you can use mspec-teamcity-prunner.exe, which is a drop-in replacement for the standard MSpec runner.

创建/编辑标准 MSpec构建步骤在TeamCity的,然后用 mspec-TeamCity的-prunner.exe mspec.exe C>

Create/Edit a standard MSpec Build Step in TeamCity and then replace the path to mspec.exe with mspec-teamcity-prunner.exe

默认情况下该工具将运行到并行2试件,但是这可以通过使用控制 - 线程N)(如 - 线程4 4线程)在其他命令行参数:字段

By default the tool will run up to 2 test assemblies in parallel, but this can be controlled by using --threads N) (e.g. --threads 4 for 4 threads) in the Additional command line parameters: field.

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

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