dsh-test-runner

September 12, 2026 · View on GitHub

DeepSeek Harness plugin: detect a project's test framework and build a validated run command, parse runner output into structured results, and — optionally — actually run the suite behind an injectable command seam.

The detection and parsing tools are pure (text in, structure out: no filesystem, no subprocess, no network). test_run executes the built argv through the runCommand seam, which defaults to spawnSync from node:child_process; deployments and unit tests can replace it with a fake runner, so nothing has to spawn a real process to be verified.

Install

npx -y @deepseek-ai/dsh plugin --profile web add @qingshanjiluo/dsh-test-runner

Tools

ToolParametersReturns
detect_test_frameworkpackageJsonText, files{ framework, command: [argv], reason } — pure; package.json signals (vitest > jest > mocha) outrank file markers (pytest, go.mod, Cargo.toml, phpunit.xml, *_spec.rb)
test_parseOutputtext, framework{ framework, passed, failed, skipped, failures[], parsed, truncated, note } — pure; understands vitest, jest, mocha, pytest, go test, cargo test, phpunit, and rspec summaries, never throws
test_runcwd, framework, packageJsonText, files, pattern, timeoutMs{ ok, framework, command, exitCode, passed, failed, skipped, failures[], truncated, parsed, note, message } — detect, run through the seam, parse combined stdout+stderr

pattern is validated to a single safe token before it reaches an argv (no whitespace, no leading -), and the command is passed as an argv array to spawnSync without a shell, so quoting is not an attack surface.

Configuration

FieldTypeDefaultPurpose
jsRunnerstringnpxLauncher for JS runners (npx, pnpm, yarn; on Windows use npx.cmd etc. if spawnSync cannot resolve the shim)
timeoutMsnumber120000Default per-run timeout; also the cap for a caller-requested timeoutMs
maxFailuresnumber20Hard cap on failures returned by either result tool
runCommandfunctionspawnSync seamInjectable process runner: (argv, cwd, timeoutMs) => { exitCode, stdout, stderr }

Development

npm install --no-audit --no-fund
npx tsc --noEmit
npm run build
npx vitest run
node scripts/load-smoke.mjs

License

MIT