fix(api): include repo ansible roles path
All checks were successful
Code Review / ai-code-review (push) Successful in 16s
CD Pipeline / tests (push) Successful in 1m39s
CD Pipeline / build-and-deploy (push) Successful in 5m4s
CD Pipeline / post-deploy-checks (push) Successful in 1m45s

This commit is contained in:
Your Name
2026-06-27 15:26:10 +08:00
parent 7431098651
commit 1c765e5459
2 changed files with 22 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import inspect
import os
from datetime import UTC, datetime, timedelta
from pathlib import Path
from types import SimpleNamespace
@@ -1418,6 +1419,9 @@ def test_ansible_check_mode_command_uses_check_diff_and_selected_ssh_transport(t
assert str(repair_key) in spec.command[-1]
assert str(known_hosts) in spec.command[-1]
assert "apply" not in " ".join(spec.command)
assert str((playbook_root / "roles").resolve()) in spec.env[
"ANSIBLE_ROLES_PATH"
].split(os.pathsep)
def test_ansible_apply_command_uses_controlled_apply_without_check(tmp_path: Path) -> None:
@@ -1448,6 +1452,9 @@ def test_ansible_apply_command_uses_controlled_apply_without_check(tmp_path: Pat
assert "ansible_ssh_private_key_file" in spec.command[-1]
assert str(repair_key) in spec.command[-1]
assert str(known_hosts) in spec.command[-1]
assert str((playbook_root / "roles").resolve()) in spec.env[
"ANSIBLE_ROLES_PATH"
].split(os.pathsep)
def test_ansible_controlled_apply_builds_auto_repair_receipt() -> None: