Install the latest ruby2.5-rubygem-parallel_tests ruby2.5-rubygem-parallel_tests
packages from YaST:Head OBS and enjoy lightning fast "rake test:unit"
in yast2-storage-ng :-)
(The "devel_yast" pattern has been adapted, running "zypper dup"
should be enough.)
I have spent some time speeding up the unit tests in yast2-storage-ng package. The
reason was that running all tests took several minutes, about 3 minutes even on
a quite fast CPU. So after doing even a small change you would have to wait
several minutes to see whether you did not break something by mistake.
The main bottleneck was the sequential start of the tests, so even on a quad core CPU
only one CPU was actually used.
I have added parallel_test gem  support to "rake test:unit" and turned that
on in yast2-storage-ng package. (By default the standard sequential RSpec is used.)
It uses all available CPUs and scales almost linearly, the speed up is about
A similar approach I have used in Travis, originally we used license check, Rubocop,
yardoc, unit tests, package build, ... everything sequentially in one Travis job.
Fortunately Travis supports defining multiple jobs which run independently and are
started in parallel.
I have split the Travis work in yast2-storage-ng into three groups: unit tests,
rubocop and the rest (yardoc, package build...).
If you want to use a similar solution in your package then check the documentation
I wrote about this: the Travis , the unit tests .
Some real numbers to see the improvement:
- Running "rake test:unit" locally: from 2:47s to 0:38s (speedup ~4.3x on a
core CPU with HT on)
- Similar speed up in "rake osc:build" (it just additionally prepares the
- OBS package build: from 323s-505s to 102s-235s
(checked several builds, it highly depends on the speed of the worker)
- Travis speed up: from 8-10 minutes to 3-4 minutes (parallel jobs + parallel tests)
SUSE LINUX, s.r.o. e-mail: lslezak(a)suse.cz
Lihovarská 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
To contact the owner, e-mail: yast-devel+owner(a)opensuse.org