austenc's avatar

Speed Up Tests? (Codeception)

I've got a L4 app (dev environment on homestead) that has a fairly large test suite (currently 121 functional tests). Having all these tests is great, but running them all can take quite a while. I've explored options for speeding them up, but have yet to find anything that really works for me yet and wanted to see if anyone has any other suggestions. Here's what I've tried / done:

  • Grunt tasks to only run a given part of the overall suite. This works and is helpful when writing tests, but eventually you need to run them all!

  • In-memory sqlite database -- this would be awesome, except it doesn't seem to work with multiple connections defined in the laravel database config. I'd have to explore this route again (have done it twice now!) to recall more details, but I recall it being caused by the codecept Db module not playing nicely with multiple connections. Unfortunately my app utilizes several databases so I have to have multiple connections.

Are there any other options / possibilities to speed up test runs? It seems like sqlite is the way to go.... if only I could get it to work with multiple connections!

Thanks!

0 likes
2 replies
olimorris's avatar

You didn't mention if you're running Vagrant with VirtualBox or VMWare. On my Mac I noticed 90% speed increases since I switched to VMWare. Sure it cost me about £50 for the licence but it was money absolutely well spent.

I noticed my CodeCeption tests boosted massively as well as just booting up Laravel.

austenc's avatar

@olimorris thanks for the tip! I'm definitely using virtualbox and have considered swapping to vmware.. Unfortunately I also use windows and linux pc's as development machines and our other developers are all on windows. I'll definitely give it a shot on my laptop though, cheers!

Please or to participate in this conversation.