mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 02:49:43 +00:00
Copy additional backup locations in jobs (#5890)
Instead of copying the backup in the main job, lets copy them in separate job per location. This allows to use the same backup error handling mechanism as for add-ons and folders. This makes the stage introduced in #5784 somewhat redundant, but before removing it, let's see if this approach works out.
This commit is contained in:
@@ -729,11 +729,26 @@ async def test_backup_to_multiple_locations_error_on_copy(
|
||||
assert result["data"]["jobs"][0]["name"] == f"backup_manager_{backup_type}_backup"
|
||||
assert result["data"]["jobs"][0]["reference"] == slug
|
||||
assert result["data"]["jobs"][0]["done"] is True
|
||||
assert result["data"]["jobs"][0]["errors"] == [
|
||||
assert len(result["data"]["jobs"][0]["errors"]) == 0
|
||||
|
||||
# Errors during copy to additional location should be recorded in child jobs only.
|
||||
assert (
|
||||
result["data"]["jobs"][0]["child_jobs"][-1]["name"]
|
||||
== "backup_copy_to_additional_locations"
|
||||
)
|
||||
assert (
|
||||
result["data"]["jobs"][0]["child_jobs"][-1]["child_jobs"][0]["name"]
|
||||
== "backup_copy_to_location"
|
||||
)
|
||||
assert (
|
||||
result["data"]["jobs"][0]["child_jobs"][-1]["child_jobs"][0]["reference"]
|
||||
== ".cloud_backup"
|
||||
)
|
||||
assert result["data"]["jobs"][0]["child_jobs"][-1]["child_jobs"][0]["errors"] == [
|
||||
{
|
||||
"type": "BackupError",
|
||||
"message": "Could not copy backup to .cloud_backup due to: ",
|
||||
"stage": "copy_additional_locations",
|
||||
"stage": None,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user