Testing: is RefreshDatabase efficient enough? Got a proposal. #36019
-
Hi @people, you know the
A question: does this work if I use transactions in my tests, or will that collide with the test suite transactions? A remark: running the migrations can take up to 10s of seconds. It is a lot of time at the end of the say, if I run my tests say every 5 minutes. A proposal: CakePHP has a test suite light, that cleans up the dirty tables before each test, without dropping the tables at any times. And without using transactions. So the migrations get run once and for all. Would it be of the interest of Laravel to propose an adapter? Or do you think there is no chance a PR will make its way through? Here is a bit of material on that approach: https://www.youtube.com/watch?v=PNA1Ck2-nVc&t=1100s |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It depends... + AFAIK it conflicts with #35422 (not yet tested)
You can extend RefreshDatabase to make it smarter, eg https://github.com/LastDragon-ru/lara-asp/blob/master/packages/testing/src/Database/RefreshDatabaseIfEmpty.php 😀 |
Beta Was this translation helpful? Give feedback.
It depends... + AFAIK it conflicts with #35422 (not yet tested)
You can extend RefreshDatabase to make it smarter, eg https://github.com/LastDragon-ru/lara-asp/blob/master/packages/testing/src/Database/RefreshDatabaseIfEmpty.php 😀