bash_unit icon indicating copy to clipboard operation
bash_unit copied to clipboard

[FEATURE REQUEST] Using `parallel` to multithreading?

Open dalisoft opened this issue 1 year ago • 2 comments

Hi @pgrange

Using parallel could be improve test time? It is possible?

dalisoft avatar Apr 27 '24 09:04 dalisoft

That's an interesting challenge, I'm not sure about the implication in the code base and I don't plan to tackle that right now but let's keep it open, you never know.

In the meantime, I see a path for you to rely on parallel and check if that improves your execution time and that would be by running different tests files in parallel. So it wouldn't be bash_unit which would run all the tests in parallel but rather you who would have to run bash_unit in parallel with all the test files and then, each test file would run the tests sequentially but in parallel with the other test files.

For instance, if I want to do that to run the tests of bash_unit, I would probably do something like that (running inside bash_unit repository):

parallel ./bash_unit ::: tests/test_*                                            

And I can, indeed, observe a slightly better test time.

I'm aware it's not perfect as it's relying on you to organize your tests so that they're not in the same file if you want to run them in parallel. But maybe that can help you with bash_unit as it is know.

Cheers,

pgrange avatar Apr 28 '24 10:04 pgrange

Thank you for detailed response and solution for my use cases.

bash_unit really helped much in my project to keep project much stable and reliable and allows me add features without losing code old functionality.

so let’s keep opened as you suggested.

Thank you again

cheers,

dalisoft avatar Apr 28 '24 11:04 dalisoft