orchestral / testbench

Laravel Testing Helper for Packages Development
https://packages.tools/testbench
MIT License
2.11k stars 136 forks source link

Package migrations don't get executed anymore with v8.22 (core v8.23) #399

Closed finpension-aless closed 8 months ago

finpension-aless commented 8 months ago

Description:

After updating the orchestra libraries to the new version released on March 12th/13th, our tests fail and when I debug the problem I notice that our Laravel migrations don't get executed anymore. We still use the trait "RefreshDatabase" and in our setUp method we still call "$this->loadMigrationsFrom(DIR . '/../../database/migrations');", nothing changed there since the update.

Steps To Reproduce:

Execute a test that uses the database and has some Laravel migrations.

finpension-aless commented 8 months ago

The issue seems to be with orchestra/testbench-core v8.23 When I downgrade it back to 8.22.1 the tests go through again.

crynobone commented 8 months ago

Don't use RefreshDatabase with loadMigrationsFrom outside of defineDatabaseMigrations method: https://github.com/orchestral/testbench-core/discussions/194

We have never suggested using loadMigrationsFrom within setUp() method.