feat(trigger): add local trigger run audit records

This commit is contained in:
chengyongru
2026-07-02 13:32:46 +08:00
committed by Xubin Ren
parent b941233138
commit 661ab00656
7 changed files with 246 additions and 19 deletions
+12
View File
@@ -52,6 +52,18 @@ def test_add_job_accepts_valid_timezone(tmp_path) -> None:
assert job.state.next_run_at_ms is not None
def test_write_run_record_uses_cron_runs_dir(tmp_path) -> None:
service = CronService(tmp_path / "cron" / "jobs.json")
service.write_run_record("job:1", {"status": "queued"})
record_path = tmp_path / "cron" / "runs" / "job_1.json"
record = json.loads(record_path.read_text(encoding="utf-8"))
assert record["run_id"] == "job:1"
assert record["status"] == "queued"
assert record["updated_at_ms"] > 0
@pytest.mark.asyncio
async def test_unbound_agent_jobs_are_disabled_on_add(tmp_path) -> None:
called: list[str] = []