I'm currently building an automatic tests using selenium and Behat for a PHP application that is uses MySQL for database with InnoDB engine. The database is around 50GB with a lot of data in it. The tests are running fine, but currently I'm struggling with the cleanup before every new test run.
Since the tests are inserting data (creating users for e.g) I would like to put the DB in known state before each tests is running. A cleanup script is pretty complicated to do without side effects because of the many relations between data.
My question is if there any good practice for restoring the DB to a known state in a fast way (50GB is a lot of data) just before the Behat features are executed?
Don't test with 50GB of data. Create a database with less data specifically for testing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With