Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute tests in parallel using runsettings file on VS2013

we have moved from VS2010 to VS2013 environment. Our solution has over 5K unit tests and on VS2010 they took about 5 minutes while on VS2013 they are taking about 20 minutes.

We saw that there is an issue using the testsettings file as it configures VS2013 to use the former test framework so we moved it to a runsettings file which in facts solves some problems we had on the transition.

The main think right now is that we cannot find how to configure VS2013 to execute the tests in parallel. On the former VS we had the <Execution parallelTestCount="0"> setting which seems to be non available on the runsettings file.

Summarizing, how can we run tests in parallel using a runsettings file so we use the newer framework?

Thanks.

like image 667
Ignacio Soler Garcia Avatar asked Jul 14 '14 13:07

Ignacio Soler Garcia


People also ask

How do I run a parallel test in Visual Studio?

Visual Studio 2019 runs unit tests sequentially when it is suppose to run them in parallel. Click on the Run Tests in Parallel button in Test Explorer. Make sure the icon is highlighted. Run unit tests.

How do you use Runsettings?

Manually select the run settings fileIn the IDE, select Test > Configure Run Settings > Select Solution Wide runsettings File, and then select the . runsettings file. This file overrides the . runsettings file at the root of the solution, if one is present, and is applied across all tests run.

How do I make Codecoverage Runsettings?

You can enable this in runsettings by adding <Format>Cobertura</Format> or <Format>Xml</Format> in the DataCollector configuration section in your runsettings file. This format can be viewed in the code coverage results window in Visual Studio Enterprise.

What determines if the runner must parallelize tests at the method or class level?

Scope : Determine if the runner must parallelize tests at the method or class level. MethodLevel will run all tests in parallel. ClassLevel will run all test classes in parallel, but tests in a class are run sequentially. You should use ClassLevel if the tests within classes have interdependencies.


1 Answers

You use ?

You can force VS2013 to use the 2010-2013 test settings file. You can add FileName.testsettings into the 2013 .runsettings file.

<MSTest>
      <CaptureTraceOutput>True</CaptureTraceOutput>
      <DeploymentEnabled>false</DeploymentEnabled>
      <SettingsFile>FILENAME.testsettings</SettingsFile>
      <ForcedLegacyMode>True</ForcedLegacyMode>
</MSTest>
like image 131
Valentin Avatar answered Nov 15 '22 03:11

Valentin