I would suggest you use this trait lluminate\Foundation\Testing\RefreshDatabase It will migrate the database from new in the first test. Then in all the tests it will use transactions to easily (and automatically) roll back the database after the test is done. You can also give parallel testing a shot to speed it up
Dec 14, 2022
2
Level 8
Laravel large scale testing strategy
Looking for advice or some reading material. I have an app which I redistribute. I have over 400 tests across a suite of feature tests. It takes 5 mins and can be unreliable in the results. Mainly because I use a mix of seeded data and generated data. I would like to refresh the db after every feature test. But having the seeded data is handed. This will only scale larger so seeking some advice as I will need to pause Dev and make my testing more reliable.
Thanks
Please or to participate in this conversation.