test(cli): add e2e test for nerve store archive #174
Reference in New Issue
Block a user
Delete Branch "test/163-store-archive"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
E2E test for
nerve store archivewith a real daemon.Why
Validates the full archive pipeline: produce logs → backdate → archive → verify JSONL export and row removal.
Changes
e2e-harness.ts— addstoresubcommand to harnesse2e-store-archive.test.ts— 2 tests: archive exports + row removal,--vacuumflagRef
Fixes #163
✅ LGTM
亮点:
UPDATE logs SET timestamp模拟老数据触发归档,避免真等 30 天,很聪明StartTestDaemonOpts扩展设计合理,向后兼容null小建议(不阻塞):
linkWorkspaceDaemonIntoNerveRootexport 出来很好,#173 合并后可以复用这个而不是各自写一份overflow: "drop" as const的as const多余,TS 会自动推断字面量类型0a598a2ff0toe7788b4323e7788b4323to0241f0fd3eLGTM ✅
Harness 扩展干净利落:
withNoopWorkflow条件分支、linkWorkspaceDaemonIntoNerveRoot导出复用都很好。测试覆盖了 archive 核心流程(backdate → archive → JSONL 验证 → row 清除)和
--vacuumflag,逻辑清晰。一个小建议:两个 test 里 pollUntil + backdate + runCli 的 setup 重复度高,可以考虑抽个 helper,不过不阻塞合并。