|
|
330c0c9246
|
test(commondev): 守住 rawfile/ 不进库却决定包能否运行的隐患
## 背景
`example/commondev/rawfile/.gitignore` 写着 `*`:rawfile 里是随包资源
(可能是上百兆 node/pi 二进制),进版本库会让克隆变慢、每次升级产生
巨型 diff。**这是设计意图**,不是疏忽。
但代价很具体:
本地打包 → 包里 571 个 runtime 条目(工作区已备好资源)→ 冒烟通过
CI 打包 → 包里 0 个 runtime 条目(干净克隆没有资源) → 插件起不来
而两次构建的**日志都写着"成功"**。这类"本地绿、别处坏"我们吃过一次:
TestHmapdevTemplateImplementsAllPluginMgrMethods 读了 gitignore 的文件,
本地绿、CI 红。
本次尤其危险:interrupt 的实现**同时**落在 sidecar.mjs(已进库)和
rawfile/runtime/*/sidecar.mjs(未进库)两处。只改前者,判据全绿、
包里的 sidecar 却还是旧的 —— 取消能力在发布版里根本不存在。
## 判据做什么
不能要求 rawfile/ 必须有内容(干净克隆本来就没有)。但可以:
· 有内容时,每个 CLI 目录必须有 sidecar.mjs 或 driver.json
· pi/zcode 的 sidecar **必须**支持 interrupt
· 没有内容时,用 t.Logf **大声说明**"此状态下打出的包不含 sidecar",
让这件事出现在测试输出里,而不是静默
## 变异
删掉 rawfile/runtime/pi/sidecar.mjs 的 interrupt case →
判据报"打包后 commondev_agent_interrupt 会失效(源码改了但资源没同步)"
|
2026-10-18 10:18:40 +08:00 |
|