diff --git a/Makefile b/Makefile index 752ce25..40b88d0 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,10 @@ db_drop_db_template: db_drop_all: ./script/database/db_drop_all.py +.PHONY: db_drop_test +db_drop_test: + ./script/database/db_drop_all.py --test_only + .PHONY: db_clean_cache db_clean_cache: ./script/db_restore.py --clean_cache diff --git a/script/database/db_drop_all.py b/script/database/db_drop_all.py index ad6b9be..b9987d0 100755 --- a/script/database/db_drop_all.py +++ b/script/database/db_drop_all.py @@ -22,6 +22,11 @@ def get_config(): epilog="""\ """, ) + parser.add_argument( + "--test_only", + help="test and test_* and other by system test.", + action="store_true", + ) args = parser.parse_args() return args @@ -32,6 +37,12 @@ def main(): out_db = execute_shell("./.venv/bin/python3 ./odoo/odoo-bin db --list") lst_db = out_db.split("\n") for db_name in lst_db: + if config.test_only and not ( + db_name in ("test",) + or db_name.startswith("test_") + or db_name.startswith("new_project_") + ): + continue execute_shell( "./.venv/bin/python3 ./odoo/odoo-bin db --drop --database" f" {db_name}"