[阶段7] 补分层冒烟测试 #26

Closed
opened 2026-08-21 13:31:31 +08:00 by tao.chen · 0 comments
Owner

为新的分层契约补 smoke 测试,防止后续重构悄悄破边界。

  • domain/execution.pyExecutionResult dataclass 实例化 + 默认值
  • domain/context.pyTERMINAL_NODE_STATES / FAILED_NODE_STATES 不可变性 + 成员正确
  • infrastructure/storage/client.py — httpx mock 上传 run log(参照 test_janitor.py 风格)
  • execution/worker.py — 已有 test_worker.py,改 import 路径即可
  • scheduling/scheduler.pystart / stop 生命周期 smoke 测试
  • application/service.py — 构造 + 关闭的 mock 路径,验证三个组件都被 wire

Executor: Codex

验证:

  • uv run --package schedule pytest schedule/tests -q 全绿,至少 6 个新测试通过
  • 不需要真实 MySQL / httpx server,全部用 mock + tmp dir

约束: 不引入 pytest 插件;httpx 用 respx 或直接 unittest.mock;参照现有 test_janitor.py / test_worker.py 的风格。


Task: spbez05t1j7wku8lkwdq7kh3

<p>为新的分层契约补 smoke 测试,防止后续重构悄悄破边界。</p> <ul> <li><code>domain/execution.py</code> — <code>ExecutionResult</code> dataclass 实例化 + 默认值</li> <li><code>domain/context.py</code> — <code>TERMINAL_NODE_STATES</code> / <code>FAILED_NODE_STATES</code> 不可变性 + 成员正确</li> <li><code>infrastructure/storage/client.py</code> — httpx mock 上传 run log(参照 <code>test_janitor.py</code> 风格)</li> <li><code>execution/worker.py</code> — 已有 <code>test_worker.py</code>,改 import 路径即可</li> <li><code>scheduling/scheduler.py</code> — <code>start</code> / <code>stop</code> 生命周期 smoke 测试</li> <li><code>application/service.py</code> — 构造 + 关闭的 mock 路径,验证三个组件都被 wire</li> </ul> <p><strong>Executor:</strong> Codex</p> <p><strong>验证:</strong></p> <ul> <li><code>uv run --package schedule pytest schedule/tests -q</code> 全绿,至少 6 个新测试通过</li> <li>不需要真实 MySQL / httpx server,全部用 mock + tmp dir</li> </ul> <p><strong>约束:</strong> 不引入 pytest 插件;httpx 用 respx 或直接 unittest.mock;参照现有 <code>test_janitor.py</code> / <code>test_worker.py</code> 的风格。</p> --- <sub>Task: spbez05t1j7wku8lkwdq7kh3</sub>
tao.chen added the priority:lowstatus:to-do labels 2026-08-21 13:31:34 +08:00
tao.chen added status:in-progress and removed status:to-do labels 2026-08-21 14:48:04 +08:00
tao.chen added status:done and removed status:in-progress labels 2026-08-21 14:53:35 +08:00
tao.chen added status:archived and removed status:done labels 2026-08-24 10:09:10 +08:00
tao.chen reopened this issue 2026-08-24 10:09:14 +08:00
tao.chen added the status:in-review label 2026-08-24 14:21:37 +08:00
tao.chen removed the status:in-review label 2026-08-24 14:25:19 +08:00
tao.chen reopened this issue 2026-08-24 14:25:33 +08:00
tao.chen added the status:to-do label 2026-08-24 14:25:50 +08:00
tao.chen added status:done and removed status:to-do labels 2026-08-24 14:50:09 +08:00
tao.chen added status:in-review and removed status:done labels 2026-08-24 14:50:26 +08:00
tao.chen reopened this issue 2026-08-24 14:50:32 +08:00
tao.chen added the status:done label 2026-08-24 14:50:33 +08:00
tao.chen added status:to-do and removed status:done labels 2026-08-24 14:50:49 +08:00
tao.chen reopened this issue 2026-08-24 14:50:52 +08:00
tao.chen removed the status:in-review label 2026-08-24 14:51:01 +08:00
tao.chen reopened this issue 2026-08-24 14:51:08 +08:00
tao.chen added the status:done label 2026-08-24 14:51:08 +08:00
tao.chen added status:in-review and removed status:done labels 2026-08-24 14:51:32 +08:00
tao.chen reopened this issue 2026-08-24 14:51:36 +08:00
tao.chen added status:done and removed status:to-dostatus:in-review labels 2026-08-24 14:53:16 +08:00
Sign in to join this conversation.