refactor(lab): move execution to Worker and manage replay and transfer lifecycles

This commit is contained in:
DCCONSTRUCTIONS
2026-11-10 01:09:39 +03:00
parent cd34b6ce1a
commit fe5900ff3b
101 changed files with 9305 additions and 2256 deletions
+14 -4
View File
@@ -1461,7 +1461,7 @@ def test_capability_projection_delete_removes_only_catalog_projection(
).fetchone()[0] == 0
def test_capability_projection_mutations_reject_source_legacy_and_corrupt_rows(
def test_lab_projection_mutations_admit_legacy_but_reject_source_and_corrupt_rows(
tmp_path: Path,
) -> None:
repository = tmp_path / "repo"
@@ -1539,7 +1539,14 @@ def test_capability_projection_mutations_reject_source_legacy_and_corrupt_rows(
)
connection.commit()
for session_id in (source.name, legacy.session_id, corrupt.session_id):
with sqlite3.connect(store.database_path) as connection:
connection.execute(
"UPDATE observation_lab_instances SET include_recorded_media = NULL "
"WHERE session_id = ?",
(legacy.session_id,),
)
for session_id in (source.name, corrupt.session_id):
with pytest.raises(SessionIntegrityError, match="capability-owned"):
store.rename_capability_lab_projection(session_id, "Нельзя изменить")
with pytest.raises(SessionIntegrityError, match="capability-owned"):
@@ -1551,7 +1558,11 @@ def test_capability_projection_mutations_reject_source_legacy_and_corrupt_rows(
store.delete_capability_lab_projection(mismatch.session_id)
assert store.get_session(source.name).summary.session_id == source.name
assert store.get_session(legacy.session_id).summary.display_name == "LAB E21 · legacy"
assert store.rename_capability_lab_projection(legacy.session_id, "Архив") == "Архив"
store.delete_capability_lab_projection(legacy.session_id)
with pytest.raises(SessionNotFoundError):
store.get_session(legacy.session_id)
assert source.is_dir()
with sqlite3.connect(store.database_path) as connection:
retained_ids = {
row[0]
@@ -1561,7 +1572,6 @@ def test_capability_projection_mutations_reject_source_legacy_and_corrupt_rows(
}
assert {
source.name,
legacy.session_id,
corrupt.session_id,
mismatch.session_id,
} <= retained_ids