STARDUSTLC666/dsh-flakefinder ↗★ 0
dsh-flakefinder
DSH 测试稳定性插件:flaky_detect/history/quarantine/clear/report 五工具,重复运行测试并识别不稳定用例,SQLite-free JSON 历史与隔离清单,零运行时依赖。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:STARDUSTLC666/dsh-flakefinder说明文档
阅读完整 README ↗dsh-flakefinder
让 agent 分清「代码坏了」还是「测试在抽风」。
DeepSeek Harness 测试稳定性插件:重复运行测试并识别 flaky 用例,历史留档、隔离清单、写操作审批门。零运行时依赖。
工具
| 工具 | 作用 | 写操作 |
|---|---|---|
flaky_detect | 重复运行测试 N 次,判定 stable-pass / stable-fail / flaky | 否(写历史) |
flaky_history | 查询检测历史,按目标过滤 | 否 |
flaky_report | 汇总隔离清单 + 历史,输出稳定性报告 | 否 |
flaky_quarantine | 把 flaky 用例写入 .flakefinder.json 隔离清单 | 是(审批门) |
flaky_clear | 从隔离清单移除已恢复的用例 | 是(审批门) |
支持框架:
- vitest:读取
node_modules/vitest/vitest.mjs,使用 JSON reporter - jest:读取
node_modules/jest/bin/jest.js,使用--json --outputFile - node:test:
node --test --test-reporter=tap,解析 TAP framework: auto按 vitest → jest → node:test 自动探测
安装
dsh plugin --profile web add dsh-flakefinder
或手动安装后在 profile 的 cordis.patch.yml 插入:
- id: flakefinder
name: 'dsh-flakefinder'
config:
defaultRuns: 5
writeApproval: true
使用示例
用户:src/checkout.test.ts 最近老失败,帮我判断一下
Agent:
flaky_detect(target="src/checkout.test.ts", runs=5)
→ 判定:flaky;3/5 通过,失败集中在 useFakeTimers 用例
→ flaky_quarantine(tests=["src/checkout.test.ts > 定时器恢复"], reason="定时器竞态")
配置
| 字段 | 默认 | 说明 |
|---|---|---|
defaultRuns | 5 | flaky_detect 默认重复次数(3-20) |
maxRuns |