-
Hi, Just migrated to Laravel Permission. It is quite great, but my functional testing is now 5minutes instead of 1min. This is mainly because I use in-memory database, so, for each of my 113 tests, I have to seed the permission table that contains 105 rows ( and it keeps growing each time I add a model) So, I had to leave in-memory DB to a local Posgres DB, with an initial seeding. I only seed once my DB, and then execute all my tests. While my tests runs within a minute once more, this is not so great, because my tests are not independant anymore. If I delete a row in DB in a test, it may affect the next one. Besides, I am now tring to use the new --parallel flag to run phpunit tests in parallel with paratest, and this is also failing as initial seeding is not being well managed when having several threads. Is there a way to maintain in-memory DB testing without losing performance ? Maybe using permission caching when testing ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A new |
Beta Was this translation helpful? Give feedback.
A new
setUpTestDatabase
method was recently added to help with initial seeding issues:laravel/framework#36301
and laravel/docs#6848