如何并行运行 NUnit 测试? [英] How can I run NUnit tests in parallel?

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

问题描述

我有一个使用 NUnit 编写的大型验收测试(每个测试约 10 秒)测试套件.我想利用我的机器都是多核盒这一事实.理想情况下,我可以为每个内核运行一个测试,独立于其他测试.

I've got a large acceptance test (~10 seconds per test) test suite written using NUnit. I would like to make use of the fact that my machines are all multiple core boxes. Ideally, I'd be able to have one test running per core, independently of other tests.

有 PNUnit,但它是为测试线程同步问题和类似问题而设计的,我没有看到实现此目的的明显方法.

There is PNUnit, but it's designed for testing for threading synchronization issues and things like that, and I didn't see an obvious way to accomplish this.

是否有可用于并行运行测试的开关/工具/选项?

Is there a switch/tool/option I can use to run the tests in parallel?

推荐答案

如果你想并行运行 NUnit 测试,至少有 2 个选项:

If you want to run NUnit tests in parallel, there are at least 2 options:

  • NCrunch 提供开箱即用的功能(无需更改任何内容,但它是一种商业产品)
  • NUnit 3 提供了 Parallelizable 属性,可以用来表示哪些测试可以并行运行
  • NCrunch offers it out of the box (without changing anything, but is a commercial product)
  • NUnit 3 offers a Parallelizable attribute, which can be used to denote which tests can be run in parallel

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

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