Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/utils/generate_tool_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
from pathlib import Path
from typing import Any

# Realistic placeholder for path-like sample fields so generated samples never
# contain null for a required field (e.g. model_path).
SAMPLE_MODEL_PATH = r"C:\Temp\mcp_demo\part.SLDPRT"

# ---------------------------------------------------------------------------
# Tool registry — built from AST, not runtime import, so no SolidWorks needed
# ---------------------------------------------------------------------------
Expand Down
38 changes: 38 additions & 0 deletions tests/integration/test_tool_catalog_drift.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Fail when a committed tool-catalog page drifts from the generator's output."""
from __future__ import annotations

import filecmp
import subprocess
import sys
from pathlib import Path

REPO_ROOT = Path(__file__).resolve().parents[2]
GENERATOR = REPO_ROOT / "src" / "utils" / "generate_tool_catalog.py"
CATALOG_DIR = REPO_ROOT / "docs" / "user-guide" / "tool-catalog"


def test_tool_catalog_matches_generator(tmp_path: Path) -> None:
subprocess.run(
[
sys.executable,
str(GENERATOR),
"--output-dir",
str(tmp_path),
"python",
],
cwd=REPO_ROOT,
check=True,
)

committed = sorted(p.name for p in CATALOG_DIR.glob("*.md"))
generated = sorted(p.name for p in tmp_path.glob("*.md"))
assert committed == generated, (
f"catalog page set differs: committed={committed} generated={generated}"
)

drifted = [
name
for name in committed
if not filecmp.cmp(CATALOG_DIR / name, tmp_path / name, shallow=False)
]
assert not drifted, f"tool catalog pages drifted from the generator: {drifted}"
Loading