Closed crynobone closed 7 months ago
@crynobone Hello 👋
Sadly, this has caused a regression, at least on my end. I'm also aware this logic was moved to the InteractsWithTestCase
trait.
I've been using the RefreshDatabase
trait for quite some time, even after Laravel 11 upgrade, but after this change, the trait still works, but the migrations are executed before each test, which seems unwanted (at least from my point of view), which in turn makes the tests slow as the more migrations you have, the slow it will be 😞
Do i need to change something on my end?
Thank you!!
This PR only available for Testbench Core 6 and was done for forward compatibility up until 9.
Oh yeah, my mistake. There are two RefreshDatabase
usages in Testbench.
While Laravel application mostly uses structure 1, Package developers have been known to use structure 2, which led to the above changes. We will need to rethink this
No problem.
I'm pretty much on structure 1 but on a package, testing against a MySQL database not a in memory one (i know it's a bit unconventional).
I have for now implemented a workaround so it does not use the RefreshDatabaseState::$migrated
Let me know if there's anything i can help to address it.
I'm pretty much on structure 1 but on a package, testing against a MySQL database not a in memory one (i know it's a bit unconventional).
RefreshDatabase
in Laravel 11 for :in-memory:
was changed to work similarly to a persistent database which prompted these changes (tests will break with structure 2).
@brunogaspar can you test the latest patch release and see if that fixed your issue.
@crynobone Yes, that seemed to have fixed it.
Thank you!!
coverage: 92.414% (+0.01%) from 92.402% when pulling 3a575f75b4cf97f957974df3e18f9bc122af1af5 on 9/reset-refresh-database-state-between-tests into c86b66e16b3313b12c13575ed3b4cfedcb57e950 on 9.x.