samedi 10 février 2018

Laravel tests don't rollback transaction after each test

My Tests are using the trait RefreshDatabase to "migrate fresh" before starting tests and use transactions for each testing method.

The migration works fine, but the transactions are not working at all.

I try to expose my setup:

  • MariaDB 10.1 running in a docker container (I already proofed that all tables being used in my tests are in InnoDB, so transactions are supported)
  • The base test class is using the RefreshDatabase
  • I tried a separate connection for testing together with $connectionsToTransact and also using the default connection for testing. Transaction do not work either

I tried to debug already and also came down to PDO something starting and rolling back a transaction, so it seems like the laravel code attempt to transact and rollback, but it does not have any affect in my tests.

I need ideas what else could go wrong

Aucun commentaire:

Enregistrer un commentaire