The test suite for my Lua project is split up into multiple files inside the spec/ directory.
Is there a way to ask busted to run those tests in parallel? If I call busted without any arguments it runs all the tests sequentially.
Is there a way to run a Busted test suite in parallel?
283 Views Asked by hugomg AtThere are 2 best solutions below
On
I don't understand much about the Busted library, but apparently what you want is working with multiple threads
Threads are basically the process where the code executes line by line until the end. When we create more threads for a code, multiple loops, functions, etc ... within this new Thread, they executed simultaneously with the original code, without interfering in the process, that is, more than one thing is executed in parallel.
Unfortunately Lua does not contain a way to perform multiple threads, the most it has to work with threads is coroutines. However, there are libraries like lua-llthreads that perform this task, try it out and see what you think. By joining it with your code with Busted, you will be able to perform parallel tasks
One thing that seems to work is to use GNU Parallel to run multiple test scripts at once.
The
-o utfTerminalis to tell busted to use the familiar "green circles" output instead of the simplified text output it uses when its stdout is redirected.