mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
test_fixtures: Clean up interface for template_database_status().
1) Created a new class `DatabaseType` and access its objects inside `template_database_status()` instead of sending five arguments with default values. 2) Made `check_files` and `setting_name` local variables instead of function parameters since they had same value(None) for every call. Fixes #13845.
This commit is contained in:
committed by
Tim Abbott
parent
96b0ec705d
commit
eb23c6fa6c
@@ -172,12 +172,7 @@ def main(options: argparse.Namespace) -> int:
|
||||
else:
|
||||
print("RabbitMQ is already configured.")
|
||||
|
||||
migration_status_path = os.path.join(UUID_VAR_PATH, "migration_status_dev")
|
||||
dev_template_db_status = template_database_status(
|
||||
migration_status=migration_status_path,
|
||||
settings="zproject.settings",
|
||||
database_name="zulip",
|
||||
)
|
||||
dev_template_db_status = template_database_status('dev')
|
||||
if options.is_force or dev_template_db_status == 'needs_rebuild':
|
||||
run(["tools/setup/postgres-init-dev-db"])
|
||||
run(["tools/do-destroy-rebuild-database"])
|
||||
@@ -186,7 +181,7 @@ def main(options: argparse.Namespace) -> int:
|
||||
elif dev_template_db_status == 'current':
|
||||
print("No need to regenerate the dev DB.")
|
||||
|
||||
test_template_db_status = template_database_status()
|
||||
test_template_db_status = template_database_status('test')
|
||||
if options.is_force or test_template_db_status == 'needs_rebuild':
|
||||
run(["tools/setup/postgres-init-test-db"])
|
||||
run(["tools/do-destroy-rebuild-test-database"])
|
||||
|
||||
Reference in New Issue
Block a user