Skip to content
Merged
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
29 changes: 15 additions & 14 deletions examples/canary/catalog-run-e2e-smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
REPO_ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(REPO_ROOT))

import loopx.canary.runner as runner_module # noqa: E402
from loopx.canary.runner import ( # noqa: E402
build_catalog_canary_run,
normalize_canary_command,
Expand Down Expand Up @@ -107,22 +106,24 @@ def assert_domain_checks_precede_family_checks() -> None:


def assert_git_required_smoke_skips_without_git_worktree() -> None:
original_root = runner_module.REPO_ROOT
with tempfile.TemporaryDirectory() as temp_dir:
temp_root = Path(temp_dir).resolve()
(temp_root / "examples" / "control_plane").mkdir(parents=True)
runner_module.REPO_ROOT = temp_root
try:
payload = build_catalog_canary_run(
catalog_path=REPO_ROOT / "docs/concepts/interaction-pattern-catalog.md",
profiles=["repo-architecture-budget"],
max_checks_per_profile=1,
check_limit=1,
execute=True,
timeout_seconds=10,
)
finally:
runner_module.REPO_ROOT = original_root
# TMPDIR may be inside a checkout. A bare repository stops Git's
# ancestor discovery without providing a worktree to the check.
subprocess.run(
["git", "init", "--bare", "--quiet", str(temp_root)], check=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
)
payload = build_catalog_canary_run(
catalog_path=REPO_ROOT / "docs/concepts/interaction-pattern-catalog.md",
profiles=["repo-architecture-budget"],
max_checks_per_profile=1,
check_limit=1,
execute=True,
timeout_seconds=10,
repo_root=temp_root,
)

assert payload["ok"] is True, payload
assert payload["failure_count"] == 0, payload
Expand Down
Loading