Suppose you run your unit tests with phpunit tests
To run them in parallel, shuffling their order, you can switch the command line to:
find tests -type f -name '*Test.php' | shuf | parallel --gnu -L 1 phpunit
Here's what that pipeline does:
- Finds all files ending in Test.php (via "find")
- Shuffles the order of the files (via "shuf")
- Then runs as many in parallel as CPU cores (via "parallel")
Give it a whirl and see how ideal your unit tests are!
0 comments:
Post a Comment
Share your thoughts!