Testdelta

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Oct 25, 2026

Base-vs-head test result differ: named tests added, removed, and changed, never raw counts.

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

一个本地 MCP 服务器,用于对比两份具名测试结果集,报告哪些测试回归、修复、新增或移除。

可以做什么
对比 base 与 head 两份测试结果集,可来自含 base.json 和 head.json 的目录,或同时包含两个对象的单个文件,返回 REGRESSED 或 NO-REGRESSION 结论,并列出具名的回归、修复、新增、移除、持续失败及其他状态变化的测试,以及按严重程度排序的发现项。
适用场景
当测试运行器或 CI 任务已为两个版本写出 pass/fail/skip 结果,而你需要助手明确指出具体哪些具名测试失败或被修复,而不是比较原始计数时使用。
运行要求
通过 npx 或 Docker 以 stdio 作为本地进程运行。需要一个包含 base.json 和 head.json 的目录,或含 base 与 head 对象的单个 JSON 文件,状态仅限 pass、fail 或 skip。未声明账号、密钥或网络访问需求。
安装前请注意
它只读取结果文件,不运行测试也不生成状态,结果须事先产生。测试名按精确字符串匹配,重命名的测试会显示为一个移除和一个新增。格式错误或未知状态会报错。人类可读报告每类最多列出 50 个名称。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Testdelta,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

testdelta

Diff two named test result sets and report exactly which tests regressed, which were fixed, which were added, and which were removed. Never raw counts without names: every category in the human report lists the test names in it.

What it does

testdelta compares a base result set against a head result set. Each set maps a test name to one of three statuses: pass, fail, or skip. From the two sets it computes:

  • Regressions: tests that were pass or skip in base and are fail in head.
  • Fixes: tests that were fail in base and are pass in head.
  • Added: tests that exist only in head, with their head status.
  • Removed: tests that exist only in base, with their base status.
  • Still-failing: tests that are fail in both sets.
  • Unchanged: tests present in both sets with the same status, other than fail in both.
  • Other changes: tests present in both sets whose status changed in a way that is neither a regression nor a fix, for example pass to skip.

Name lists are sorted alphabetically within each category, and the output is deterministic: no timestamps and no random ordering.

Findings highlight the categories a human should look at first:

  • One high finding per regression (rule REGRESSION, evidence such as base=pass head=fail).
  • One info finding per fix (rule FIXED).
  • One medium finding per removed test that was passing (rule REMOVED-PASSING).
  • One low finding per added test that is failing (rule ADDED-FAILING).

Input formats

Directory with base.json and head.json

Point testdelta at a directory containing two files:

base.json:

json
{  "test-login": "pass",  "test-checkout": "pass",  "test-search": "fail"}

head.json:

json
{  "test-login": "fail",  "test-checkout": "pass",  "test-search": "pass"}

In this example test-login is a regression and test-search is a fix.

Single file with base and head objects

A single JSON file can carry both sets:

json
{  "base": {    "test-login": "pass",    "test-search": "fail"  },  "head": {    "test-login": "fail",    "test-search": "pass"  }}

Missing files, missing base or head objects, malformed JSON, and status values other than pass, fail, or skip are errors. The CLI reports the error and exits with code 2.

Install

sh
npx @reneturcios/testdelta diff ./results

Or install it globally:

sh
npm install -g @reneturcios/testdelta

CLI usage

sh
# Human readable report (default target is the current directory)testdelta diff [path]
# Machine readable JSON reporttestdelta diff [path] --json
# Run as an MCP server over stdiotestdelta mcp
# Print the versiontestdelta --version

Exit codes:

  • 0: the verdict is NO-REGRESSION.
  • 1: the verdict is REGRESSED.
  • 2: usage error, including missing or invalid input.
  • 141: the reader closed the output pipe early (the shell-visible equivalent of SIGPIPE).

In the human report, each category lists test names, capped at 50 names per category. When a category has more, the list ends with an explicit and N more line instead of truncating silently. The JSON report always carries the full findings list.

MCP tool

The MCP server exposes one tool:

diff_test_results

  • Input: path, the target directory or single result file.
  • Output: the full JSON report, with the verdict, the counts for every category, the findings, and a summary that names the counts and the first regression names.

Verdict rules

  • REGRESSED: at least one regression exists, meaning a test that was pass or skip in base is fail in head.
  • NO-REGRESSION: no regressions. Added failing tests, removed tests, and tests that were already failing in base do not change the verdict on their own; they are reported as findings and counts so a human can decide.

Limits

  • testdelta works on result files. It does not run tests, and it does not produce the pass, fail, or skip values itself; a test runner or CI job has to write the result sets first.
  • Test name matching is exact string equality. A renamed test appears as one removed test and one added test, not as a change.
  • Only the three statuses pass, fail, and skip are understood. Map any other runner outcome onto one of them before diffing.

来源:README.md,提交 f586e50

工具

1

diff_test_results

Diff two test result sets from a directory containing base.json and head.json, each a JSON object mapping test names to pass, fail, or skip. Returns named regressions (pass to fail), fixes (fail to pass), added and removed tests, and a verdict of REGRESSED or NO-REGRESSION.

输入参数path必填

版本历史

1
  1. v0.1.0最新Oct 25, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分