SuperAPI AI 工具集

driver-test-runner

测试与质量

查看项目

更新于 10-16 08:01

技能介绍

用途:按文件逐个运行 RivetKit driver 测试套件,覆盖 native(NAPI)与 wasm 两种运行时,把进度写入 ~/.agents/notes/driver-test-progress.md,避免一次性跑全套。

主要能力:支持参数 reset、resume(默认)、only <file>、from <file>、runtime <native|wasm|both>(默认 both)、encoding <bare|cbor|json>(默认 bare)、registry <static>(默认 static)。默认每个测试文件跑两遍:native/local 与 wasm/remote,均为 encoding=bare;只有两个运行时都通过才勾选完成。矩阵选择必须用 Vitest -t 指定完整内层 describe 名称,不读取环境变量。

使用方式:先构建运行时产物并确保引擎运行。NAPI 缺失时执行 pnpm --filter @rivetkit/rivetkit-napi run build:force;wasm 缺失时执行 pnpm --filter @rivetkit/rivetkit-wasm run build。引擎健康检查 curl -sf http://127.0.0.1:6420/health,未运行则 ./scripts/run/engine-rocksdb.sh >/tmp/rivet-engine-startup.log 2>&1 &。随后在 rivetkit-typescript/packages/rivetkit 目录运行 pnpm test tests/driver/<FILE>.test.ts 并配合 -t 过滤,输出写入 /tmp/driver-test-current.log 再检查。失败时不要推进。

适用场景与限制:适合在修复 native/Rust 与旧运行时行为差异时,以 TypeScript driver 测试为主要基准;native 单元测试须在失败用例复现且修复验证后添加。wasm 不能配 local SQLite,必须配 remote,否则测试框架报错。快测 120 秒、慢测 600 秒超时,wasm 可能更慢。其他细节资料未提供。