Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Visual Studio 2012 run unit tests in parallel?

Can Visual Studio 2012 run unit tests in parallel? Visual Studio 2010 has an option to do this:

http://blogs.msdn.com/b/vstsqualitytools/archive/2009/12/01/executing-unit-tests-in-parallel-on-a-multi-cpu-core-machine.aspx

...but I can't find anything similar in Visual Studio 2012. I tried the procedure described in the referenced article, but even loading the same test settings file I was unable to run tests in parallel.

like image 878
abenci Avatar asked Oct 01 '12 13:10

abenci


4 Answers

No. VS2012 unit test framework currently does not run tests in parallel.

Edit: Moving a part of the comments with Dave into the answer for better reference.

See this link on how to enable parallel runs using the .testsettings. Once you have this configured in your .testsettings file you can then set that as the active settings file in VS and this which will force the execution in the legacy mstest framework, where this feature is available.

like image 97
allen Avatar answered Oct 03 '22 16:10

allen


You can force VS2012 to use the 2010 test settings file. You can add FileName.testsettings into the 2012 .runsettings file. This is considered legacy and probably won't be supported forever.

e.g.

<MSTest>
 <CaptureTraceOutput>True</CaptureTraceOutput>
 <DeploymentEnabled>False</DeploymentEnabled>
 <SettingsFile>FILENAME.testsettings</SettingsFile>
 <ForcedLegacyMode>True</ForcedLegacyMode>
</MSTest>
like image 26
Michiel Bugher Avatar answered Oct 03 '22 18:10

Michiel Bugher


I have a test project upgraded from 2010 to 2012. It won't run in parallel in the IDE, but using mstest.exe with the test DLL works fine.

like image 20
Keith Walton Avatar answered Oct 03 '22 17:10

Keith Walton


Visual Studio 2012 doesn't allow to run tests in parallel.

But you can try ParallelTestRunner tool to run Visual Studio 2012/2013/2015 tests in parallel from the command line.

like image 29
packet7 Avatar answered Oct 03 '22 17:10

packet7