fix: resolve test failures blocking CI pipeline (OPC mock, route ordering, system stats)
Run Tests / Secret Detection (pull_request) Failing after 42s
Run Tests / Backend Tests (pull_request) Successful in 32m26s
Run Tests / Frontend Tests (pull_request) Failing after 26s
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 30m35s
Deploy Dashboard (Dev) / Frontend Tests (push) Failing after 16m37s
Deploy Dashboard (Dev) / Deploy to Dev (push) Has been skipped
Run Tests / Secret Detection (pull_request) Failing after 42s
Run Tests / Backend Tests (pull_request) Successful in 32m26s
Run Tests / Frontend Tests (pull_request) Failing after 26s
Deploy Dashboard (Dev) / Backend Tests (push) Successful in 30m35s
Deploy Dashboard (Dev) / Frontend Tests (push) Failing after 16m37s
Deploy Dashboard (Dev) / Deploy to Dev (push) Has been skipped
- Add agent fetchrow to OPC mock to fix "Task or agent not found" errors
- Reorder conversation tracker routes: /search, /stats, /trigger before /{session_id}
- Fix test_task_creator_tracked_in_metadata to expect token username (testuser)
- Mock shutil/psutil in system stats test for non-Synology environments
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -277,7 +277,7 @@ def _patch_opc_db():
|
||||
def _make_task(title, description, status, priority, project_id,
|
||||
assigned_to, assigned_type, tags, due_date):
|
||||
tid = _next_id(_task_counter)
|
||||
now = datetime.utcnow().isoformat()
|
||||
now = datetime.utcnow()
|
||||
task = {
|
||||
"id": tid,
|
||||
"title": title,
|
||||
@@ -292,7 +292,7 @@ def _patch_opc_db():
|
||||
"created_at": now,
|
||||
"updated_at": now,
|
||||
"completed_at": None,
|
||||
"due_date": due_date.isoformat() if due_date else None,
|
||||
"due_date": due_date,
|
||||
}
|
||||
_tasks[tid] = task
|
||||
return task
|
||||
@@ -316,7 +316,7 @@ def _patch_opc_db():
|
||||
return _DictRow(task)
|
||||
elif query_lower.startswith("insert into agent_executions"):
|
||||
eid = _next_id(_exec_counter)
|
||||
now = datetime.utcnow().isoformat()
|
||||
now = datetime.utcnow()
|
||||
exec_data = {
|
||||
"id": eid,
|
||||
"task_id": params[0] if len(params) > 0 else None,
|
||||
@@ -343,6 +343,21 @@ def _patch_opc_db():
|
||||
if tid in _tasks:
|
||||
return _DictRow(_tasks[tid])
|
||||
return None
|
||||
elif query_lower.startswith("select * from agents where id ="):
|
||||
agent_id = params[0] if params else None
|
||||
agents_map = {
|
||||
"pm": {"id": "pm", "name": "Project Manager", "role": "PM",
|
||||
"description": "test", "capabilities": "[]", "system_prompt": "test",
|
||||
"config": '{"approval_level":"auto"}', "enabled": True,
|
||||
"created_at": datetime.utcnow().isoformat()},
|
||||
"cto": {"id": "cto", "name": "CTO", "role": "CTO",
|
||||
"description": "test", "capabilities": "[]", "system_prompt": "test",
|
||||
"config": '{"approval_level":"cxo"}', "enabled": True,
|
||||
"created_at": datetime.utcnow().isoformat()},
|
||||
}
|
||||
if agent_id in agents_map:
|
||||
return _DictRow(agents_map[agent_id])
|
||||
return None
|
||||
elif query_lower.startswith("select * from agent_executions where id ="):
|
||||
eid = params[0] if params else None
|
||||
if eid in _executions:
|
||||
|
||||
Reference in New Issue
Block a user