How to run parallel builds of MSpec tests?

We have the following setup:

  • Team City v8.1.2
  • .NET 2013 solution with several different C # projects (ASP.NET MVC, libraries, test projects, etc.).
  • 95% of our tests are MSpec, but we also have some NUnit tests.
  • We have 14 test projects and is growing ...

Currently, the testing phase takes approximately 9 minutes for MSpec tests and 1 minute for NUnit. We would like to start parallelizing this, since we expect the number of tests to grow rapidly. What would be the best solution, provided that:

  • MSpec does not have a parallel statement.
  • Tests must be parallelized for each assembly whose tests are performed sequentially in the same assembly.
  • Parallelization should not affect the display of assembly results. We still want everything to be aggregated, as it is now.
  • There should be no friction with local execution in the development machine. It would be necessary that, regardless of the configuration, locally more complex testing is not performed. If the solution, no matter what it is, allows us to run tests locally in parallel, that would be great.
  • We prefer to scale the parallel capabilities of each build agent, rather than working with multiple agents, because we pay for the agent.
+4
source share
2 answers

MSpec TeamCity mspec-teamcity-prunner.exe, MSpec.

/ MSpec Build Step TeamCity, mspec.exe mspec-teamcity-prunner.exe

2 , , --threads N) (, --threads 4 4 ) Additional command line parameters:.

+2

, : MSBuild exec , Albacore mspec TeamCity MSpec runner. , mspec - . mspec .

> mspec.exe [options] <assemblies>

, mspec, .

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

. , TeamCity . MSBuild, , , .

, Rake multitask. .

multitask :test => [:test_assmebly1, :test_assembly2, :test_assembly3]
0

Source: https://habr.com/ru/post/1547415/


All Articles