fix(scheduler): persist codebase inventory terminal status
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -402,7 +402,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '')
|
||||
# ==========================================
|
||||
# 系統版本與路徑
|
||||
# ==========================================
|
||||
SYSTEM_VERSION = "V10.777"
|
||||
SYSTEM_VERSION = "V10.778"
|
||||
LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log')
|
||||
public_url = PUBLIC_URL # 用於模板顯示
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> **最後更新**: 2026-07-11 (台北時間)
|
||||
> **狀態**: 🟠 Partial。四 Agent、PixelRAG、MCP/RAG registry、PChome controlled-preview families 與多項 smoke/readback 已建立;但 access control、database identity/RBAC、full asset reconciliation、software supply chain、same-run controlled apply、restore drill、internal RAG canary 與 MCP/RAG runtime closure 尚未全部完成。任何局部 receipt 不得代表整體閉環完成。
|
||||
> **適用版本**: V10.777
|
||||
> **適用版本**: V10.778
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import schedule
|
||||
|
||||
# 匯入全部排程任務函式
|
||||
from scheduler import (
|
||||
_save_stats,
|
||||
run_momo_task,
|
||||
run_edm_task,
|
||||
run_festival_task,
|
||||
|
||||
@@ -59,3 +59,23 @@ def test_scheduler_owns_daily_inventory_runtime():
|
||||
|
||||
assert 'day.at("04:15").do(run_codebase_modularization_performance_task)' in source
|
||||
assert '_save_stats("codebase_modularization_performance", payload)' in source
|
||||
|
||||
|
||||
def test_scheduler_inventory_task_persists_completed_terminal_status(monkeypatch, tmp_path):
|
||||
import run_scheduler
|
||||
|
||||
receipt_path = tmp_path / "latest.json"
|
||||
saved = []
|
||||
monkeypatch.setenv("CODEBASE_INVENTORY_RECEIPT_PATH", str(receipt_path))
|
||||
monkeypatch.setattr(
|
||||
run_scheduler,
|
||||
"_save_stats",
|
||||
lambda task_name, payload: saved.append((task_name, payload)),
|
||||
)
|
||||
|
||||
result = run_scheduler.run_codebase_modularization_performance_task()
|
||||
|
||||
assert result["status"] == "completed"
|
||||
assert result["receipt_path"] == str(receipt_path)
|
||||
assert saved == [("codebase_modularization_performance", result)]
|
||||
assert receipt_path.exists()
|
||||
|
||||
Reference in New Issue
Block a user