Run phpunit tests in parallel


#1

I’m trying to run a set of tests in parallel ( phpunit). The docs directions will not work out of the box is my guess.
$(circleci tests glob “/tests/Functional/Tests/**/*Test.php” | circleci tests split)

Did anyone implement the above and had to do changes to convert it to the pattern that phpunit accepts ? (–filter pattern) . did the splitting actually work after converting to the pattern needed?


#2

You can split by classnames and timings like the following example:

cat my_php_test_classnames | circleci tests split --split-by=timings --timings-type=classname

#3

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.


How to execute PHPUnit tests in parallel?
#4

Hi @deepa2083,

As far as I can tell, circleci tests glob and circleci tests split are incompatible with PHPUnit, as it is not possible to pass a list of filenames to phpunit. The only close match—--filter, as you identified—only accepts a REGEX match of classnames, which is not something that our native test-splitter can output.

Re-opening this in case anyone has had a different experience using PHPUnit and circleci tests split. If we can verify that it’s not currently possible, from there we can try to get some work done on our test-splitter to mitigate this issue, and also for the timebeing update our documentation to make it explicit that not all test-runners are compatible.

Thanks!