Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def restore_site(
try:
return self.bench_execute(
"--force restore "
"--verbose "
f"--mariadb-root-username {temp_user} "
f"--mariadb-root-password {temp_password} "
f"--admin-password {admin_password} "
Expand Down
25 changes: 25 additions & 0 deletions agent/tests/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,31 @@ def test_get_cors_origins_with_quoted_allow_cors(self):
],
)

def test_restore_site_passes_verbose_flag(self):
"""Ensure restore_site includes --verbose in the bench command."""
bench = self._get_test_bench()
site_name = "restore-site.frappe.cloud"
self._create_test_site(site_name)
self._make_site_config(site_name)

site = Site(site_name, bench)
with patch.object(site, "bench_execute") as mock_execute, patch.object(
bench, "create_mariadb_user", return_value=(None, "temp_user", "temp_pass")
), patch.object(bench, "drop_mariadb_user"):
Site.restore_site.__wrapped__(
site,
mariadb_root_password="root_pass",
admin_password="admin_pass",
database_file="/path/to/database.sql.gz",
public_file="/path/to/public_files.tar",
private_file="/path/to/private_files.tar",
)

mock_execute.assert_called_once()
command = mock_execute.call_args[0][0]
self.assertIn("--force restore", command)
self.assertIn("--verbose", command)
Comment thread
greptile-apps[bot] marked this conversation as resolved.

def test_get_cors_origins_skips_unsafe_hostnames(self):
sites = [
SimpleNamespace(
Expand Down