Show last run timestamp on ops automation status
Expose last_run_at / last_run on the status contract and display Last run and Tasks columns on the /ops/ui status page for the selected window.
This commit is contained in:
parent
a304ad7397
commit
6c34e2c1f1
3 changed files with 75 additions and 4 deletions
|
|
@ -75,6 +75,28 @@ def test_completed_when_expected_run_exists() -> None:
|
|||
)
|
||||
|
||||
assert report["status"] == "completed"
|
||||
assert report["last_run_at"] == "2026-06-26T07:00:10+00:00"
|
||||
assert report["last_run"]["run_id"] == "run-1"
|
||||
assert report["last_run"]["tasks_spawned"] == 1
|
||||
|
||||
|
||||
def test_last_run_picks_newest_fired_at() -> None:
|
||||
runs = [
|
||||
{
|
||||
"run_id": "older",
|
||||
"fired_at": "2026-06-26T07:00:00+00:00",
|
||||
"tasks_spawned": 0,
|
||||
},
|
||||
{
|
||||
"run_id": "newer",
|
||||
"fired_at": "2026-06-28T07:00:00+00:00",
|
||||
"tasks_spawned": 2,
|
||||
},
|
||||
]
|
||||
summary = status.latest_run_summary(runs)
|
||||
assert summary is not None
|
||||
assert summary["run_id"] == "newer"
|
||||
assert summary["tasks_spawned"] == 2
|
||||
|
||||
|
||||
def test_validation_failure_wins_over_completed_run() -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue