-
Notifications
You must be signed in to change notification settings - Fork 20
Database dump is not deleted after test is finish #227
Comments
Hi @killua99 From the documentation for this setting:
So your first suggestion (giving it a SQL dump) should already work. I would recommend this approach for any significant use of WordHat that makes changes to the WordPress site's database, because exporting the database is slow. If I remember correctly, if WordHat exports the database itself, it does not delete the .sql after the run. We could make a change to have it delete it, what do you think? I am not keen on clearing the database at the end - what I think you're getting at here is making sure it restores to its initial state (i.e. before WordHat) run, which the current implementation should be doing. |
Hi @paulgibbs thanks for answering, Correct idk if I complicated or over wrote what my main point was. The main point of this is, the dump from temporary database is not been deleted. Could be good to have an extra option that by default could be something like: database:
restore_after_test: true
backup_path: /path/to/store/tmp/database
delete_tmp_db: true The name of it, could be talk later, just throwing ideas. So is a default value to true, that always delete the tmp_db, how should we know is a tmp db? we don't pass a my-dump-file-33333.sql file, we check we don't pass a sql file, if is just a path, then we will clear the dump after all the test are done. This could improve maintaining local development clean, I found myself like with 10 dumps on my tmp folder 😊 each dump was close to 80 MB. The feature of giving a direct dump is awesome, great, but sometimes we need it to be fresh dump, and we don't want to generate a fresh dump each day or so. So TL:DR Let's build the feature to delete the tmp dump after all test are done. 👍🏽 |
👍 |
I've been trying to figure out a good way to build this. It's easy-ish to do with the |
I'll try to give some thought to this too. I didn't leave :) |
If WordHat is configured to generate a DB dump during its run, WordHat was leaving alot of files littering up PHP's temporary folder. Sorry! See #227
If WordHat is configured to generate a DB dump during its run, WordHat was leaving alot of files littering up PHP's temporary folder. Sorry! See #227
I'm finding myself delete dump databases after each test run, I thought it would be deleted after each test or having a flag to confirm I want to delete a dump.
The case is, now it generate a dump file each test I run, sometimes you have to run several tests to achieve a feature and more when it has several scenarios.
Would be a good idea, to think about this two options.
One define a database to be the restore point, so we have an option like:
That if you give a SQL file will be use for all restores points. But if we have this setting.
Is a folder where the test will dump the database and after the test is finish, it will clear the database.
The difference are on, the first one when we give the database file it wont delete it, the second one when is a path that will assume is a tmp dump and it will be deleted after that.
Sorry if this issue is wrong target or so I was seeking for help but it could also be a feature request?
Thanks for this extension btw!
The text was updated successfully, but these errors were encountered: