zcbot/tests
caoqianming fd79edb344 test(web): DB 面路由测试(tasks CRUD/files DB-aware/upload)+ 修 restore 500
测试库基建落地(docker postgres:16-alpine @5433 + migration 0001-0022,
RUN.md 补一键命令),tests/test_web_routes_db.py 10 用例补齐 nodb 套件留待面:
- tasks CRUD 全链:建(默认模型/working_dir)/列(分页壳)/详(上下文压力
  字段)/PATCH 校验/软删→列表消失→恢复/同 wd 共享 + folders 计数
- files 顶层目录 DB-aware(§7.4):rename 级联改 tasks.working_dir(tasks_
  updated=1 且 DB 生效)、running→409、move 被引用→409、递归删被引用→409、
  软删 task 后放行
- upload 配额 gate 路径 + 根目录列表(system_wd_names)+ 非法文件名 400
- clear/cancel 状态闸、models 档位列表、schedules 404 路径

修 bug(本套件抓出的存量缺陷,重构前即有):POST /v1/tasks/{id}/restore
用 ORM 脏标记恢复,updated_at 是 server-side onupdate,flush 后列被标记
expired,session 关闭后序列化读它抛 DetachedInstanceError——真软删过的
任务恢复必 500(幂等路径无脏标记故此前未暴露)。修法:flush+refresh 后
在 session 内完成 task_dict 序列化。

带测试库全量 344 全过;未设 ZCBOT_TEST_DB_URL 时干净 skip;测试库零残留。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 13:50:57 +08:00
..
golden/rendering test(rendering): golden 基线——四 profile 渲染富 fixture,docx XML 逐字节对账 2026-07-23 13:24:26 +08:00
frontend_task_progress.test.mjs fix(web): 进度条自愈——回放层强制单调完成(d1285247 复盘,bump 0.36.2) 2026-07-03 11:16:34 +08:00
test_broker_redis.py feat(broker): 外置 Redis pub/sub——蓝绿跨实例 SSE/cancel 可达(bump 0.42.0) 2026-07-06 14:51:39 +08:00
test_changelog.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
test_context_compaction.py fix(context): 窗口体量估算实测校准——50%压缩/85%折叠/占用环换 token 实测口径(bump 0.58.52) 2026-07-21 12:49:02 +08:00
test_context_fold.py fix(context): 窗口体量估算实测校准——50%压缩/85%折叠/占用环换 token 实测口径(bump 0.58.52) 2026-07-21 12:49:02 +08:00
test_disk_quota.py Stage C 收尾包:资源 yaml + 磁盘配额 + 网络放开 + 容器内源持久化 2026-05-27 08:35:53 +08:00
test_executor_docker.py fix(run_python): 超时返回超时前的部分输出 + 无缓冲(-u),模型据此续跑不整批重来(bump 0.58.36) 2026-07-17 10:53:14 +08:00
test_load_skill.py feat(skills): 用户私有 skill(.skills)+ 创作工具 + skill-creator + Web 查看页 2026-06-11 09:46:39 +08:00
test_loop_empty_response.py refactor(core): loop.py 传输健壮性层析出 llm_transport.py + _execute_tool_call 拆分 2026-07-23 12:44:22 +08:00
test_loop_malformed_retry.py refactor(core): loop.py 传输健壮性层析出 llm_transport.py + _execute_tool_call 拆分 2026-07-23 12:44:22 +08:00
test_loop_repeat_guard.py refactor(core): loop.py 传输健壮性层析出 llm_transport.py + _execute_tool_call 拆分 2026-07-23 12:44:22 +08:00
test_media_common.py refactor(tools): 媒体工具同构析出 tools/media_common.py + 17 个单测 2026-07-23 13:10:32 +08:00
test_pptx_guard.py fix(guard): ppt 伪导出根治三层——平台机检门 + 禁令去菜谱 + 脚本 hint 纪律(bump 0.40.0) 2026-07-06 13:40:54 +08:00
test_pptx_render.py refactor(web): app.py 拆分——73 路由迁 11 个 router 模块,3972 行减至 732 2026-07-23 10:18:57 +08:00
test_pysyntax.py feat(run_python): 宿主语法预检——中文正文硬拼进源码的语法坏码提前拦下+锐化诊断(bump 0.58.34) 2026-07-17 08:55:55 +08:00
test_rendering.py feat(rendering): 通用报告走平台渲染器 report profile + 基座引导,少让模型手撸 python-docx(bump 0.58.35) 2026-07-17 09:32:02 +08:00
test_rendering_golden.py test(rendering): golden 基线——四 profile 渲染富 fixture,docx XML 逐字节对账 2026-07-23 13:24:26 +08:00
test_run_python_script_path.py fix(exec): run_python script_path 宿主预检+前缀容错+code 落盘回退(bump 0.58.22) 2026-07-13 16:41:43 +08:00
test_salvage.py feat(loop): 畸形 tool_call arguments 就地抢救(salvage)省一次非流式重试(bump 0.58.24) 2026-07-15 09:20:38 +08:00
test_sandbox_check.py Stage C Step 5: main.py sandbox check + lifespan fs quota WARN 2026-05-26 16:41:16 +08:00
test_scheduler.py test(scheduler): 补 core/scheduler 服务层测试(审查 Top3 缺口)+ DB 测试门控收紧 2026-07-23 13:00:13 +08:00
test_secret_host_tools.py feat(mp): mp_search_summary 批量入参 formulas[] 定点解检索烧 token(bump 0.58.28) 2026-07-15 10:49:35 +08:00
test_shortcuts.py feat(shortcuts): 加快捷指令(触发词→完整指令,入口层确定性展开)(bump 0.35.0) 2026-07-01 14:58:55 +08:00
test_skill_model_pinning.py feat(skill): skill 定向模型——ppt 触发自动热切 GLM-5.2(bump 0.39.0) 2026-07-06 08:57:32 +08:00
test_static_vendor.py Disable static asset caching 2026-06-08 09:16:31 +08:00
test_svg_alignment_check.py fix(ppt,tools): svg 质量门末尾出 [GATE FAIL] 汇总行——失败签名从误标"Font issues"变诚实(bump 0.58.47) 2026-07-20 15:59:09 +08:00
test_system_prompt_paths.py test(prompt): 锁住 docker 下 system prompt 不漏宿主路径(药3 复核收口) 2026-06-09 11:30:32 +08:00
test_task_progress_tool.py Add task progress tool 2026-06-08 08:44:16 +08:00
test_timeout_partial.py refactor(tools): 输出处理原语移出 base.py——base 只留 Tool 基类与路径边界 2026-07-23 13:15:04 +08:00
test_tool_output_compaction.py refactor(tools): 输出处理原语移出 base.py——base 只留 Tool 基类与路径边界 2026-07-23 13:15:04 +08:00
test_toolfail_malformed.py feat(loop): 空响应防御——provider 吐空自动重试 + warn 自停不静默 done + 面板留痕(bump 0.58.32) 2026-07-15 15:29:49 +08:00
test_usage_accounting.py refactor(core): loop.py 传输健壮性层析出 llm_transport.py + _execute_tool_call 拆分 2026-07-23 12:44:22 +08:00
test_usage_report.py test(scheduler): 补 core/scheduler 服务层测试(审查 Top3 缺口)+ DB 测试门控收紧 2026-07-23 13:00:13 +08:00
test_user_skills.py feat(skills): 用户私有 skill(.skills)+ 创作工具 + skill-creator + Web 查看页 2026-06-11 09:46:39 +08:00
test_web_routes_db.py test(web): DB 面路由测试(tasks CRUD/files DB-aware/upload)+ 修 restore 500 2026-07-23 13:50:57 +08:00
test_web_routes_nodb.py test(web): 路由级测试首批(无 DB 面)——鉴权门全覆盖 + kb/skills/memory/files FS 路径 2026-07-23 13:34:07 +08:00