22 lines
568 B
Python
22 lines
568 B
Python
from __future__ import annotations
|
|
|
|
from app.store import RunStore
|
|
|
|
|
|
def test_restart_marks_unfinished_runs_interrupted(settings) -> None:
|
|
store = RunStore(settings.database_path)
|
|
store.initialize()
|
|
run, created = store.enqueue(
|
|
target_kind="task",
|
|
target_path="checks/status.py",
|
|
queue_group="checks",
|
|
)
|
|
assert created is True
|
|
|
|
store.mark_interrupted()
|
|
|
|
interrupted = store.get(run.id)
|
|
assert interrupted is not None
|
|
assert interrupted.status == "interrupted"
|
|
assert interrupted.finished_at is not None
|