All of a sudden our tests started failing today, but yesterday were working fine. Pretty much all of them were reporting that the users table does not exist.
I have narrowed it down to the migrations not being run before the test cases start even though all of the classes are using the DatabaseMigrations trait.
The odd thing is migrate:rollback seems to work since changing it to a file instead of in-memory database and migrating beforehand works for the first test case.
Continuing with this (file sqlite and running a migration before testing) and removing the DatabaseMigrations works. Running php artisan migrate --database=testing and running Artisan::call('migrate') from tinker works fine.
Anyone else experienced this? What can I do to see why the migration is failing before the tests?
For obvious reasons, I'd prefer to keep using DatabaseMigrations in a memory database.
phpunit.xml
<env name="DB_CONNECTION" value="testing"/>
config/database.php
'testing' => [
'driver' => 'sqlite',
'database' => ':memory:',
// 'database' => database_path('testing.sqlite'),
'prefix' => '',
],