是否有用于 .NET 测试的测试运行程序可以运行多线程以利用多核机器?
我目前正在使用 Thoughtworks Studios 的 Cruise 设置 CI,使用 Gallio 运行 xunit.net 事实/测试,并使用 ncover 2 进行代码覆盖。
我注意到运行我们的构建代理服务器拥有的四个 CPU 之一的代码覆盖率,并想知道是否有一个我可以使用的多线程测试运行程序,以利用其他 3 个核心闲着吗? 我进行了快速搜索,但大多数点击都是关于测试多线程代码,而不是多线程测试运行......
I'm setting up CI at present using Thoughtworks Studios' Cruise, Gallio to run xunit.net fact/tests, and ncover 2 to do code-coverage.
I noticed that running the code-coverage pegs one of the four CPUs that our build-agent server has, and wondered whether there was a multi-threaded test-runner that I might use instead, to take advantage of the other 3 cores that are sat idle? I had a quick search around, but most hits are in reference to testing multi-threaded code, not multi-threaded test running...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Gallio 实现并行测试执行。
Gallio implements parallel test execution.
在 NUnit 中,您可以传递 /thread 参数在不同的线程中生成测试执行。 我想拥有一个线程池来生成测试不会有太多的工作。 您必须确保测试中没有依赖项。
我会询问 xUnit.NET 或 NUnit 列表。 我知道 Charlie 正在努力将其纳入 NUnit 3.0。 您还可以将 PNunit 作为扩展。 还有一篇文章,有人致力于将 xUnit.NET 引入多个线程。
In NUnit you can pass a /thread parameter which spawns test execution in a different thread. I'd imagine it wouldn't be too much more work to have a thread pool to spawn tests from. You'd have to make darn sure you don't have dependencies in your tests.
I'd ask on either the xUnit.NET or NUnit lists. I know Charlie is working to make that part of NUnit 3.0. You can also look at PNunit as an extension. There's also an article with someone working towards getting xUnit.NET in multiple threads.
就在昨天,我看到了 Damon Payne 的这篇文章:
http://www.damonpayne .com/2008/05/09/ConcurrentUnitTestingWithXUnitNet1.aspx,
其中他演示了为 xUnit.NET 编写自定义测试运行程序,该运行程序使用类作为并发单元显式分发测试用例,以便利用多核。
Just yesterday i came across this post by Damon Payne:
http://www.damonpayne.com/2008/05/09/ConcurrentUnitTestingWithXUnitNet1.aspx
where he walks through writing a custom test runner for xUnit.NET that explicitly distributes test cases using the class as the unit of concurrency in order to take advantage of multiple cores.
如果不出意外,我知道在 CruiseControl.NET 中,您可以同时运行多个两个操作。 我认为克鲁斯也是如此。 您可以运行四个实例,每个实例运行 1/4 的测试,然后将结果拼接在一起。 但知道何时合并它们可能很困难。
If nothing else, I know that in CruiseControl.NET, you could multiple two operations run simultaneously. I would think the same would be true for Cruise. You could have four instances of run on 1/4 of your tests each, and then stitch the results back together. Knowing when to merge them may be difficult though.