Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Your CI is green. Your tests might be lying.

说明与用途

testguard 检测隐藏真实错误的测试模式,可用作 CI 检查,防止合并削弱测试覆盖率的 PR。

问题

A test suite can appear green while actually not exercising production code, due to patterns that mask failures.

结果

testguard identifies 10 suspicious patterns in a faulty test file and none in a clean one, enabling teams to catch hidden bugs before they reach production.

工作流

  • Run testguard on the test directory (e.g., python -m testguard tests/).
  • Review the report for suspicious patterns and their severity.
  • Configure CI to fail on high‑severity findings using --fail-on high or report only with --fail-on none.
  • In PR review, use diff mode (testguard --diff HEAD main) to detect added or removed test patterns before merge.

证据

I shipped a bug last week that my test suite had "covered." The suite was green. The test just wasn't testing anything anymore.

来源

testguard scans for exactly those patterns: empty-test, fake-pass, retry-loop, swallowed-assert, deleted-test, removed-assert, focused-test, no-assert, hardcoded-sleep, mock-only, skipped-test, expected-fail.

来源

testguard reports patterns, not guilt. Treat each finding as "look here and decide", not "this code is cheating".

来源

  • 记录日期: 2026-10-19T12:41:22.984Z