Files
claude-plugin/plugins/reviews/skills/audit-terraform/tests/test_smoke.py
T
mroberts f5934181ec Move the code and terraform audits into the reviews plugin
Copy the standalone code-review and terraform-review skills into
plugins/reviews as audit-code and audit-terraform. The rename separates the
automated, linter-driven audits from the guided review-pr walkthrough that
already lived here.

Resolve bundled script paths through ${SKILL_DIR}, exported in a new step 0.
CLAUDE_PLUGIN_ROOT is not set in the Bash tool environment, so the obvious
substitution would have expanded to nothing and broken every collection
script invocation.

Replace the PLAN and DESIGN docs with READMEs written from the current
SKILL.md and scripts. The old docs had drifted badly: they named semgrep
where the code calls opengrep, scoped five review agents where there are
now eight, and predated Lua, PowerShell, and GitHub Actions support.

Add CONSISTENCY_NORMS to the audit-terraform agent inputs. The collection
script writes consistency_norms.json and the agent prompt declares it, but
SKILL.md never listed it, leaving the variable unsubstituted.

Drop the --ingest-verdicts instruction from both skills. review_stats.py
parses no arguments, so the ref-mode verdict template it told users to feed
back could never be read.

Point audit-terraform's smoke test at README.md and resolve its fixture
paths relative to the test file rather than an absolute home directory.

Tests: 197 passing (audit-code), 106 passing (audit-terraform).
2026-07-21 11:11:05 -05:00

23 lines
840 B
Python

from pathlib import Path
SKILL_DIR = Path(__file__).resolve().parent.parent
def test_imports():
from scripts import manifest # noqa: F401
def test_skill_documents_trivy_first_flow():
skill = (SKILL_DIR / "SKILL.md").read_text()
aws_bp = (SKILL_DIR / "agents/aws-bp-reviewer.md").read_text()
consistency = (SKILL_DIR / "agents/consistency-reviewer.md").read_text()
design = (SKILL_DIR / "README.md").read_text()
assert "trivy-findings.json" in skill
assert "Agents: `walkthrough-reviewer`, `aws-bp-reviewer`, `consistency-reviewer`,\n`tf-hygiene-reviewer`." in skill
assert "Trivy as the first-pass scanner" in aws_bp
assert "`trivy config` first-pass scan" in design
assert "CONSISTENCY_NORMS" in consistency
assert "consistency_norms.json" in design
assert "block_text" not in design