feat(v2): enqueue and lease durable executions

This commit is contained in:
2026-07-27 21:48:26 +02:00
parent f3858ac43a
commit 057895f138
4 changed files with 139 additions and 1 deletions
+10
View File
@@ -84,6 +84,16 @@ async def test_local_source_probe_archive_and_repository_targeted_job(
)
assert job.status_code == 201
assert "destination_path" not in job.json()
execution = await client.post(
f"/api/v2/jobs/{job.json()['id']}/executions", headers=headers
)
assert execution.status_code == 202
assert execution.json()["state"] == "queued"
duplicate = await client.post(
f"/api/v2/jobs/{job.json()['id']}/executions", headers=headers
)
assert duplicate.status_code == 409
assert duplicate.json()["code"] == "execution_active"
archived = await client.delete(f"/api/v2/sources/{source_id}", headers=headers)
assert archived.status_code == 204
assert (
+6 -1
View File
@@ -1,6 +1,11 @@
from __future__ import annotations
from backup_tool.execution import ACTIVE_STATES, TERMINAL_STATES, TransitionError, transition
from backup_tool.execution import (
ACTIVE_STATES,
TERMINAL_STATES,
TransitionError,
transition,
)
def test_transitions_are_monotonic_and_terminal_states_cannot_change() -> None: