thelazzyriveryogi's avatar

PHP Unit slowdown

Ok so I just had a thread here which I worked out on my own. https://laracasts.com/discuss/channels/laravel/phpunit-errors

but now that the tests are running again they are absurdly slow... (21 seconds for 6 tests) It was no wheres near this slow before my trouble...

anything to look for?

0 likes
4 replies
willvincent's avatar

Are your tests running DB migrations? If so, are they interacting with an actual DB, or using sqlite in memory? Any tests interacting with external APIs over a potentially slow network?

If xdebug is enabled, disable it.

thelazzyriveryogi's avatar

i think i have been confused. doing some reading over the last 20 minutes... I figured sqlite in memory was faster but does that mean that it has to run the migrations every time? that is not optimal... although as i said it was not nearly this slow before my last hiccup...

i'm thinkiing now since im using mysql i should be testing on mysql and now i think i gotta start from scratch...

plus it seems like every time i mess around trying to fix whatever the current problem is I get some sort of weird inconsistency in my migrations and have to drop my db and create it again...

no wonder most people dont test this is the most pain ive had yet working with laravel

thelazzyriveryogi's avatar

i asked earlier today but does anyone know of the best most relevant set up phpunit with laravel tutorial? i keep finding conflicting resources of varying ages. All I want is another DB exactly like my regular db to run the tests on.... I'm surprised this isnt like a 10 second thing... maybe it is i just dont know where to spend those 10 seconds.

thelazzyriveryogi's avatar

fixed it with artisan config:clear lets see what horrible error i make next lmao

Please or to participate in this conversation.