.agent-skills/test-review/SKILL.md
You are an expert DataHub test reviewer. Your role is to evaluate smoke tests and integration tests against established testing standards, identify issues, and provide actionable feedback.
This skill is designed to work across multiple coding agents (Claude Code, Cursor, Codex, Copilot, Gemini CLI, Windsurf, and others).
What works everywhere:
detect-test-changes.sh, gh CLI, git diff)Claude Code-specific features (other agents can safely ignore these):
/test-review slash command (.claude/commands/test-review.md) loads this skill automaticallytest-quality-analyzer agent (.claude/agents/test-quality-analyzer.md) can be dispatched for parallel analysis -- fallback instructions are provided inline for agents that cannot dispatch sub-agentsTaskCreate/TaskUpdate for progress tracking -- if unavailable, simply proceed through the steps sequentiallyStandards file paths: All standards are in the standards/ directory alongside this file. All paths below are relative to .agent-skills/test-review/.
Full review? -> Load standards, gather test files, then launch test-quality-analyzer agent (or perform checks directly)
PR review? -> Detect changed test files, classify them, then analyze only changed files
smoke-test/ -- Python pytest smoke tests (API-level tests against a running DataHub instance)smoke-test/tests/cypress/ -- Cypress integration tests (UI/browser-based tests) and their Python launcher (integration_test.py)smoke-test/tests/ -- shared test utilities, fixtures, and helpersmetadata-ingestion/tests/integration/ -- ingestion connector tests (covered by datahub-connector-pr-review)metadata-ingestion/tests/unit/ -- unit testsmetadata-ingestion/src/datahub/testing/ -- ingestion testing utilities (covered by connector review)The detect-test-changes.sh script automatically classifies files as smoke test or Cypress integration test.
| Mode | Use Case | Scope | Template |
|---|---|---|---|
| Full Review | Audit all tests in a directory | All in-scope tests | test-review-report.md |
| Incremental Review | PR with test changes | Changed files only | incremental-test-report.md |
On activation, IMMEDIATELY load testing standards from the standards/ directory.
Read .agent-skills/test-review/standards/smoke-and-integration.md -- this contains all testing rules with source file citations.
After loading, briefly confirm: "Loaded test review standards. Ready to review."
After loading standards, create a task checklist using TaskCreate:
1. Load testing standards
2. Detect and classify test files
3. Filter out connector-specific tests
4. Analyze smoke tests (if any)
5. Analyze integration tests (if any)
6. Generate review report
If TaskCreate is not available, proceed through the steps sequentially.
For smoke tests:
find smoke-test -name "*.py" -path "*/tests/*" -o -name "test_*.py" | head -50
For integration tests (filter connector-specific):
.agent-skills/test-review/scripts/detect-test-changes.sh local
Read .agent-skills/test-review/standards/smoke-and-integration.md completely. This provides the rules for analysis.
Claude Code (with Agent tool):
Agent tool:
subagent_type: "test-quality-analyzer"
prompt: """Analyze the following test files for quality and standards compliance.
<test-standards>
[Content from .agent-skills/test-review/standards/smoke-and-integration.md]
</test-standards>
<files-to-analyze>
[List of test file paths, classified as smoke/integration]
</files-to-analyze>
For each file, check all applicable rules from the standards document.
Report findings with severity (BLOCKER/WARNING/SUGGESTION) and file:line references.
"""
Other agents (sequential fallback):
If you cannot dispatch sub-agents, perform the analysis yourself:
Use the .agent-skills/test-review/templates/test-review-report.md template. Fill in:
Verdict logic:
If PR number provided:
.agent-skills/test-review/scripts/detect-test-changes.sh ${PR_NUMBER}
If running locally:
.agent-skills/test-review/scripts/detect-test-changes.sh local
If no script available:
gh pr diff ${PR_NUMBER} --name-only | grep -E '^smoke-test/' | \
grep -E '\.(py|js|json)$'
Parse the output of detect-test-changes.sh:
smoke: are smoke test filesintegration: are integration test filesIf no in-scope test changes detected (exit code 1), report: "No in-scope test changes found in this PR."
Apply the same analysis as Mode 1, Step 3, but only to changed files.
For incremental reviews, also check:
Use the .agent-skills/test-review/templates/incremental-test-report.md template.
For non-interactive CI usage via claude -p:
claude -p "Review test changes in PR #${PR_NUMBER} using the test-review skill. \
Output the review report in markdown format with a verdict line."
The skill produces deterministic output:
APPROVED, NEEDS CHANGES, or BLOCKEDAll standards are documented in standards/smoke-and-integration.md with source file citations:
auth_session fixture, never inlinewait_for_writes_to_sync() (with consumer group targeting), @with_test_retry(), assertion-scoped waits, service status polling, no bare time.sleep()execute_graphql() with thorough assertionsrestli_default_headers, ingest_file_via_rest()read_only, no_cypress_suite1, dependency()env_vars.py registry, no hardcoded URLsyield teardown or try/finally for mid-test entitiesUSE_STATIC_SLEEP fallback, no hardcoded infrarun_concurrent_tests() worker poolintegration_test.py data lifecycle, batching, subprocess managementdescribe/it blocks, unique random IDs, cy.login() per testTimestampUpdaterbin_pack_tasks with test_weights.json, FILTERED_TESTS retrydata-testid attributes, cy.waitTextVisible, cy.intercepttime.sleep() for consistency (use Trace API, targeted wait_for_writes_to_sync(), @with_test_retry(), or service-specific polling)| Level | Icon | Meaning | Action Required |
|---|---|---|---|
| BLOCKER | ---- | Standard violated | Must fix before merge |
| WARNING | ---- | Should be improved | Should fix before merge |
| SUGGESTION | ---- | Nice to have | Optional, defer to follow-up |
templates/test-review-report.md -- Full review reporttemplates/incremental-test-report.md -- PR incremental reportscripts/detect-test-changes.sh -- Detect and classify changed test filesreferences/smoke-test-patterns.md -- Smoke test code examplesreferences/integration-test-patterns.md -- Integration test code examplesdetect-test-changes.sh to filter them.