fix(scheduler): the dashboard no longer says a job has not run "this session" — runs are kept across restarts

This commit is contained in:
2026-10-17 23:22:13 +02:00
parent 8fd91b7b15
commit 911527a548
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -12,7 +12,7 @@ from datetime import datetime, timedelta, timezone
import pytest
from sqlalchemy import select
from app import jobruns, logs, quota, scheduler, state
from app import jobruns, logs, logsink, quota, scheduler, state
from app.models import AuditLog, JobRun, Notification, QuotaEvent
from app.runstatus import RunStatus, RunTrigger
@@ -208,6 +208,8 @@ def test_a_runs_log_lines_carry_its_id(db):
(run,) = _runs(db, "autotag")
inside, after = (logs.record_fields(r).get("run_id") for r in handler.records)
assert (inside, after) == (run.id, None)
# …and it reaches the stored row, whose columns are the model's.
assert logsink.to_row(logs.record_fields(handler.records[0]))["run_id"] == run.id
def test_retention_reaps_finished_runs_only(db):