Documentation for 'cleanup' configuration option
Hi,
seems like the documentation for the 'cleanup' configuration option ist not correct:
cleanup: false - whether the dump should be reloaded before each test
It think more correct would be:
cleanup: false - whether all database tables should be dropped
I am not quite sure if this dropping happens once or before each test. The docs mention the 'clearing' of the database, but not in connection with this option.
Make this more precise would be great!
Actually cleanup does both things - drops all tables and loads the dump file.
Documentation:
populate: false - whether the the dump should be loaded before the test suite is started cleanup: false - whether the dump should be reloaded before each test
I had another look today. Multi-DB change back in 2018 made cleanup code really difficult to follow.
I see that cleanup is dependent on populate - if populate is off, then cleanup setting has no effect.
The actual logic is:
public function _beforeSuite()
{
if ($populate) {
if ($cleanup) {
dropAllTables();
}
loadDump();
}
}
public function _before()
{
if ($cleanup && $populate) {
dropAllTables();
loadDump();
}
}
Also they have additional conditions and only run if either dump file is non-empty or populator setting is set.
populator setting is not mentioned in Config section, but has it's own chapter right after examples.
Thank you for having a look and specifying what actually happens.
Maybe the docs for cleanup could be like:
cleanup: false - whether the dump should be reloaded before each test, this includes the dropping of all tables