Harden flow advancement exit assertions

This commit is contained in:
2026-05-23 16:41:21 +02:00
parent 72a0950a35
commit d4e2c1a461
4 changed files with 82 additions and 2 deletions

View File

@@ -370,3 +370,25 @@ class TestFlowEndpoints:
r = await client.get(f"/workstreams/{ws['id']}")
assert r.json()["status"] == "finished"
async def test_advance_workstream_respects_current_exit_assertions(self, client):
await _create_domain(client)
topic = await _create_topic(client)
ws = await _create_workstream(client, topic["id"], slug="exit-blocked-ws")
dependency_ws = await _create_workstream(client, topic["id"], slug="unfinished-dep")
task = await _create_task(client, ws["id"])
await client.patch(f"/tasks/{task['id']}", json={"status": "done"})
await client.post(
f"/workstreams/{ws['id']}/dependencies/",
json={
"to_workstream_id": dependency_ws["id"],
"description": "Dependency must finish first",
},
)
r = await client.post(f"/flows/workstream/{ws['id']}/advance/finished")
assert r.status_code == 409
assert r.json()["detail"]["blocking_assertions"][0]["id"] == "dependencies.all_complete"
r = await client.get(f"/workstreams/{ws['id']}")
assert r.json()["status"] == "active"