I have created a basic Lumen
application and I try to run few tests using PHPUnit.
When I run a simple call to phpunit in my local terminal it takes about 120ms for the tests to be completed. However, when I run the same call in homestead machine
(vagrant) it takes more than 3seconds(!) to complete! That’s insane.
I’ve done some testing and it seems that the tests them self aren’t slow it just that phpunit is super slow to boot on homestead. I guess it might be slow for homestead to execute the phpunit executable? The same is true for composer which is much slower ran on homestead than on my local terminal, but it is not as slow as phpunit in terms of percentages.
Any idea how I can fix this “delay” and make phpunit tests run fast on homestead as-well?
is due the filesystem used to mount Windows’ Folders on homestead.
Homestead is managed by Vagrant that uses VirtualBox to launch Virtual Machines, and Virtual Box use vboxsf as a file system, I don’t know why but this is too slow to run PHPUnit.
I guess you have your code on the windows’ folders and reach it from homestead using the standard shared folder provided by Vagrant/VirtualBox.(That is my case)
I mounted a Windows Shared Folder (my code is there) using CIFS as a file system and reduced the execution time of my tests from 58.46s to 6.51s.
Here you find the indications to this: https://wiki.ubuntu.com/MountWindowsSharesPermanently