AgentSkillsCN

test:review

对测试质量进行严格把关——确保断言严谨、无隐匿跳过、覆盖范围全面。

SKILL.md
--- frontmatter
name: test:review
description: Review tests for quality - assertive checks, no hidden skips, proper coverage

Test Review

Review test quality to ensure tests actually catch failures.

When to Use

  • After writing new tests (before committing)
  • When reviewing a PR with test changes
  • When tests pass but behavior seems wrong
  • Periodic test suite health check

Anti-Patterns to Catch

Anti-PatternProblemFix
assert TrueAlways passes, tests nothingAssert specific values
@pytest.mark.skip without reasonHides failures silentlyAdd reason or remove
@pytest.mark.xfail without ticketAccepted failures without trackingLink to issue
try/except: pass in testSwallows errorsLet exceptions propagate
assert response is not NoneOnly checks existence, not correctnessAssert status code + content
assert len(items) > 0Doesn't verify contentAssert specific items or properties
Empty test bodyTest exists but does nothingImplement or delete
Hardcoded timeouts sleep(30)Flaky, slowUse wait_for / retry pattern

Review Checklist

  • Assertive: Every test asserts specific expected values
  • No silent skips: @skip has a reason and linked issue
  • No xfail without tracking: @xfail references a ticket
  • Error cases tested: Not just happy path
  • Deterministic: No flaky timing dependencies
  • Isolated: Tests don't depend on execution order
  • Named clearly: Test name describes what it verifies
  • Cleanup: Resources created in test are cleaned up

Review Command

Search for anti-patterns in test files:

bash
grep -rn "assert True\|assert False\|@pytest.mark.skip\|@pytest.mark.xfail\|pass$" kagenti/tests/

Search for weak assertions:

bash
grep -rn "is not None\|!= None\|assert .*>" kagenti/tests/ | grep -v "# ok"

Related Skills

  • test:write - Write new tests following standards
  • test:run-kind - Run tests on Kind
  • test:run-hypershift - Run tests on HyperShift
  • tdd:ci - TDD workflow that includes test review