✅ test(e2e): 建立真机 Provisioning 与配对旅程 - #307
Open
JunLang-7 wants to merge 9 commits into
Open
Conversation
通过设备与串口双重租约、只读分区 Profile guard 和 application-only flash,阻止并发占用及交叉刷写。 复用既有 provisioning、readiness 与 pairing 边界,严格判定 Wi-Fi、SNTP、Gateway auth 和 pending 到 expired,并在所有路径吊销临时身份、复位设备和释放租约。 Host/Python 171 项测试与 72 项 CTest 通过;当前环境无已连接真机,因此未生成 SparkBot/PCB 硬件成功证据。 Closes 1024XEngineer#287 Refs 1024XEngineer#283 1024XEngineer#132
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
在远端注册前登记可预测设备 ID 的撤销补偿,避免 SSH 或响应校验失败后遗留 active 测试身份。 将本地租约与临时目录标记为无需远端 deadline 的 cleanup,使 revoke 超时后仍能释放关键本地资源;同时保留探测和构建的 timeout 分类。 新增回归测试并通过 175 项 Python、72 项 CTest 及 Ruff 检查。 Refs 1024XEngineer#287
使用 esptool 5 的连字符命令,并将 HIL 子进程启动失败稳定归类为 infrastructure。\n\n新增命令范围与错误分类回归测试;PCB application-only flash 及芯片回读哈希已实测通过。\n\nRefs 1024XEngineer#287
对齐 Ruff 0.12.7 的格式化输出。 Refs 1024XEngineer#287
合并 mock 与异常断言上下文,满足 Ruff SIM117。\n\n验证:Ruff 0.12.7 format/check 与 HIL adapter 单测通过。\n\nRefs 1024XEngineer#287
对齐 Runner adapter 选择分支的 Ruff 0.12.7 格式。 验证:Ruff 0.12.7 format/check 与相关 Python 测试通过。 Refs 1024XEngineer#287
JunLang-7
force-pushed
the
feat/287-hil-provisioning-pairing
branch
from
August 19, 2026 03:37
cc92dc7 to
d0be95e
Compare
真实设备会重复上报 pending,旧状态机将正常生命周期误判为乱序;远端 Gateway revoke 也可能超过 5 秒,导致成功 journey 被清理超时覆盖。 允许重复 pending 幂等观测,失败结果降级为 contract-only evidence,并为 HIL 使用 30 秒清理预算;同时修正 PCB 活动 OTA 槽选择、SNTP/启动失败 marker 和串口路径处理。 182 个 Python 测试通过,Ruff 0.12.7 与全量格式门禁通过;Schema v4 PCB 真实 HIL run 8652f086ec7d94b0f52d3a71bdad8b4a 的 provisioning、readiness、pairing、evidence、cleanup 全部通过。 Refs 1024XEngineer#287
本机 clang-format 22 与 CI 固定的 clang-format 18 对短 block 的格式化结果不同,导致格式任务失败。 恢复为 CI 18.1.8 的单行输出;使用同版本执行全量格式脚本已通过。 Refs 1024XEngineer#287
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目标结果
建立首条接入共享 Runner 的 ESP32-S3 provisioning/auth/pairing HIL journey,并覆盖 PCB 正式 Profile 的真实设备生命周期。
主要变更
验证
真实环境覆盖说明
本 PR 已有 PCB 的完整 provisioning/auth/pairing HIL 成功 evidence。SparkBot 仍仅覆盖共享 Runner contract 和 Profile guard,不声称其真实设备 journey 已通过。
非目标
风险与回退
Closes #287
Refs #283 #132
SparkBot 真机尝试(2026-08-19)
已接入
/dev/cu.usbmodem14401并完成只读芯片/分区探测:ESP32-S3 rev 0.2,MAC98:a3:16:c7:81:b0。本次未烧录任何内容,失败发生在本地构建尺寸检查:固件voicelife.bin为0x2d8a80,现有factory分区为0x2d0000,超出0x8a80字节;因此未进入 provision/pairing,hardware_verified=false。串口和设备 lease 均在 cleanup 释放。完整明文日志与 evidence:
/private/tmp/issue-287-sparkbot-hil-retry.jTiwrQ/run.log、/private/tmp/issue-287-sparkbot-hil-retry.jTiwrQ/evidence/evidence-659d20838af77105c1dd2d4879448edb.json。这不是 SparkBot HIL 通过证据;扩大factory或迁移分区表需要单独的硬件迁移授权,当前 PR 不宣称已完成。