How do I run MSpec test assemblies in parallel?

寵の児 提交于 2019-12-04 11:22:29

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.

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

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.

Anthony Mastrean

I'm not sure how you've configured the test part of your build: an MSBuild exec task, an Albacore mspec command, or the built-in TeamCity MSpec runner. No matter, they all run the mspec command line at some point. The command-line usage of mspec is to pass all the test assemblies to the test runner.

> mspec.exe [options] <assemblies>

The general solution then is to construct multiple mspec runs, each configured to run a single assembly.

> mspec.exe [options] <assmebly1>
> mspec.exe [options] <assembly2>
> mspec.exe [options] <assembly3>

Then you would run each of those tasks in parallel. I don't think TeamCity has the notion of parallel steps. MSBuild does not seem have general parallel tasks either, but you can fake it with an extension.

Other build systems do provide parallel tasks, like Rake's multitask. Provided you configure each individual task, you can mark the parent task to run all dependent tasks in parallel.

multitask :test => [:test_assmebly1, :test_assembly2, :test_assembly3]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!