Skip to content

✅ test(e2e): 增加日程提醒消费旅程 - #375

Open
jing-gou wants to merge 2 commits into
1024XEngineer:mainfrom
jing-gou:dev/351-schedule-reminder-hil
Open

✅ test(e2e): 增加日程提醒消费旅程#375
jing-gou wants to merge 2 commits into
1024XEngineer:mainfrom
jing-gou:dev/351-schedule-reminder-hil

Conversation

@jing-gou

Copy link
Copy Markdown
Collaborator

结论

增加 Issue #351 的 Host/HIL 提醒链用户旅程 runner、夹具、板卡 descriptor 模板和证据测试。

背景

Issue #351 要求验证最多三次提醒、IM/语音单侧与并发消费、snooze、Gateway 不可用重试、设备重启恢复以及 attempt 4 不产生。

改动范围

  • 增加 scripts/schedule_reminder_e2e.pyscripts/run_schedule_reminder_e2e.py
  • 增加 Host 固定时钟矩阵、HIL 语音入口和 SparkBot/PCB descriptor 模板。
  • 增加提醒链断言、失败分类和脱敏 evidence。
  • 没有修改日程 CRUD、IM 绑定、Gateway 内部实现、真实微信 UI 或声学验收。

接口与依赖影响

复用现有统一 E2E Runner、设备租约、公开提醒动作和百炼语音脚本;不改变运行时接口、数据模型或依赖版本。

测试与构建证据

Host 矩阵和 Python 测试随 PR 提供;真实 HIL 结果需在目标板卡和 Gateway 可达时单独生成,未执行部分不会标记为通过。

已知风险

当前 HIL 路径需要设备 ready、Gateway 和 BAILIAN_KEY_FILE;外部 Gateway 故障应分类为 external/retryable,不得误报发送成功。

兼容窗口与回退

只新增测试 runner、fixture 和 descriptor 模板,不改变既有产品路径。回退本 PR 即可删除新增文件。

Refs #351

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本次审阅覆盖了新增的 Host/HIL runner、设备 descriptor、启动包装器和 Python fixtures。Host 的现有断言测试及共享 runner 测试通过,但 HIL 路径和 Issue #351 的完整场景覆盖仍存在会影响实际验收的正确性问题。

验证:python3 -m unittest tests/python/test_schedule_reminder_e2e.py -vpython3 -m unittest tests/python/test_e2e_runner.py tests/python/test_e2e_hil_adapter.py -vpython3 -m py_compile scripts/schedule_reminder_e2e.py scripts/run_schedule_reminder_e2e.py tests/python/test_schedule_reminder_e2e.py

) from error
if completed.returncode != 0:
raise RunnerFailure(FailureCategory.DEVICE, "reminder_voice_failed")
return {"status": "passed", "voice_report": "sanitized"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Make the HIL result satisfy its own assertions

ReminderHilAdapter inherits ReminderHostAdapter.assert_result, which requires terminal, single_consume, concurrent_winner, snooze, and no_attempt_four to be true. However, this run() method returns only status and voice_report, so any successful voice subprocess reaches the assert phase with five mismatches and is reported as product/assert journey_assertion_failed; a mocked successful subprocess reproduces this. The HIL command therefore cannot ever produce a passing run until it returns the reminder-chain facts or overrides the assertions with checks for the actual HIL journey.

str(max(30, int(context.phase_budget()))),
]
try:
completed = subprocess.run(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Pass the descriptor port to the voice runner

The adapter validates and leases descriptor.port, but this subprocess call does not pass that path through. run_bailian_sparkbot_test.sh selects SPARKBOT_SERIAL (or its hard-coded default) and the adapter does not set that environment variable, so --device can lease one board while the voice test talks to another port or fails because the default is absent. This also makes the PCB and SparkBot descriptor templates ineffective for selecting the target hardware; propagate self.descriptor.port into the subprocess environment or command arguments.

return "restored" if self.task.status == "pending" else "terminal"


def run_host_matrix() -> dict[str, Any]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Exercise all required Host journey scenarios

run_host_matrix() only drives attempts, acknowledge, concurrent acknowledge, and snooze, then returns passed based only on terminal state and delivery count. The declared scenarios for restart recovery, outbox/Gateway retry without false success, and voice-output failure are never run or asserted, so the Host evidence can be green while the Issue #351 acceptance criteria for those failure and recovery paths remain completely unverified. Add those cases to the matrix and include their results in the pass condition/evidence before treating this runner as coverage for the issue.

@jing-gou

Copy link
Copy Markdown
Collaborator Author

PCB HIL 执行记录(2026-08-26)

  • Host runner:通过;三套 Python E2E 测试分别为 350 = 5 passed、351 = 2 passed、352 = 2 passed。
  • PCB 固件:构建成功,应用分区 ota_0 @ 0x20000 写入并 verify 成功;MCP 日程/提醒/IM 工具启动完成。
  • DashScope preflight:1/1 成功。
  • PCB 真实 HIL:350、351、352 均已执行,均分类为 device 失败;设备 Wi-Fi 配网帧已写入,但 WIFI_STA_DISCONNECTED reason=201(未找到 SSID),未达到 wifi_ready/sntp_synced/ready,因此没有伪造通过。
  • 证据目录:/tmp/voicelife-hil-evidence(本机保存,未上传凭据或完整串口日志)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant