记忆

Testing Gate

试用

A testing gate checker for test coverage, strategy validation, and regression verification.

它能做什么

A testing gate checker for test coverage, strategy validation, and regression verification.

技能文档

Testing Gate Skill

Overview

A general-purpose testing gate checker that validates test coverage, test strategy soundness, and regression necessity. Use it as a quality gate before merging or releasing code.

Key Features

  • Coverage Checking: Validate line, branch, and function coverage against configurable targets.
  • Test Strategy Validation: Ensure test suites have unit tests and meet minimum test count.
  • Regression Verification: Detect regressions by comparing previously passing tests against current results.
  • Unified Gate API: Run all checks via a single run_all_checks entry point.
  • Thread-Safe: Concurrent checks are safe via internal locking.
  • Serialization: Full JSON round-trip for metrics, strategies, and results.

Use Cases

  • CI/CD quality gates before merge
  • Release-readiness verification
  • Regression detection after changes
  • Test coverage enforcement
  • Hotfix verification

Installation

clawhub install testing-gate

Usage

Basic Usage

from src import TestingGate, CoverageMetrics, TestStrategy

gate = TestingGate()

# Check coverage
metrics = CoverageMetrics(line_coverage=92, branch_coverage=80, function_coverage=88)
result = gate.check_coverage(metrics)
print(result.passed, result.score)

# Check test strategy
strategy = TestStrategy(
    unit_tests=["test_a", "test_b"],
    integration_tests=["test_int"],
    e2e_tests=["test_e2e"],
    min_test_count=3,
)
result = gate.check_test_strategy(strategy)

# Check regression
result = gate.check_regression({
    "previous_passing": 50,
    "current_passing": 50,
    "current_total": 50,
})

# Run all checks at once
context = {
    "coverage_metrics": metrics,
    "test_strategy": strategy,
    "regression_artifacts": {
        "previous_passing": 50,
        "current_passing": 55,
        "current_total": 55,
        "new_tests": 5,
    },
}
results = gate.run_all_checks(context)
print(gate.overall_passed())

Custom Targets

metrics = CoverageMetrics(
    line_coverage=60,
    branch_coverage=50,
    function_coverage=60,
    target_line=60,
    target_branch=50,
    target_function=60,
)

API Reference

  • check_coverage(metrics: CoverageMetrics) -> GateResult - Check coverage against targets
  • check_test_strategy(strategy: TestStrategy) -> GateResult - Check test strategy validity
  • check_regression(artifacts: Dict) -> GateResult - Check for regressions
  • run_all_checks(context: Dict) -> List[GateResult] - Run all enabled checks
  • overall_passed() -> bool - True if all recorded results passed
  • clear() - Clear recorded results

Quality Metrics

  • 80 comprehensive tests (unit + integration + e2e)
  • Thread-safe concurrent operations
  • JSON serialization support
  • MIT License

Changelog

v1.0.0 (2026-07-03)

  • Initial release
  • Coverage, strategy, and regression checking
  • Thread-safe implementation
  • 80 tests covering unit, integration, and end-to-end scenarios

相关技能

A requirement gate checker for requirement completeness, acceptance criteria, and scope validation.

1 次安装

A design gate checker for architecture validation, feasibility analysis, and impact scope assessment.

代码改完后的验证门禁。完成 feature / 重大变更 / 创建 PR / 重构 / 声称「修完」前使用——跑 8 阶段验证,其中 e2e 功能 + 真机是 READY 硬门禁(编译过 ≠ 功能可用)。覆盖 Tauri 桌面 / Web / 服务 / Skill 四类分支。本地即可跑完整验证,CI 是可选自动化强化(平台不限 GitHub Actions)。不要用于:业务领域验证、Skill 质量审查(用 skill-lint)、纯文档变更、一次性脚本。

1 次安装

Design eval test cases, run regression tests, and generate quality reports for AI Agents

1 次安装

Automate quality gates so no change reaches production without passing tests, lint, and build

作者 天轰穿