mirror of
https://github.com/wshobson/agents
synced 2026-06-21 14:13:58 +00:00
test: skip codex doctor in non-interactive envs; validator scoped to .copilot
This commit is contained in:
@@ -128,10 +128,17 @@ class TestCodexSmoke:
|
||||
a battery of structural checks and surfaces drift in the local install."""
|
||||
proc = _run(["codex", "doctor"])
|
||||
# Codex doctor returns 0 on healthy install; warnings are inline but don't fail.
|
||||
assert proc.returncode == 0, (
|
||||
f"codex doctor failed (rc={proc.returncode}):\n"
|
||||
f"--- stdout ---\n{proc.stdout[:2000]}\n--- stderr ---\n{proc.stderr}"
|
||||
)
|
||||
if proc.returncode != 0:
|
||||
# Some environments (CI containers) cannot provide a TTY; Codex doctor
|
||||
# emits "stdin is not a terminal" in stderr and returns 1. Treat that as
|
||||
# an environment limitation and skip the test rather than failing the PR.
|
||||
if proc.stderr and "stdin is not a terminal" in proc.stderr:
|
||||
pytest.skip(f"codex doctor not runnable in non-interactive env: {proc.stderr.strip()}")
|
||||
# Otherwise, a real failure — surface it.
|
||||
assert proc.returncode == 0, (
|
||||
f"codex doctor failed (rc={proc.returncode}):\n"
|
||||
f"--- stdout ---\n{proc.stdout[:2000]}\n--- stderr ---\n{proc.stderr}"
|
||||
)
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not (WORKTREE / ".codex").is_dir(),
|
||||
|
||||
@@ -561,9 +561,10 @@ def validate_gemini(report: Report) -> None:
|
||||
|
||||
|
||||
def validate_copilot(report: Report) -> None:
|
||||
# Support both the local-generation cache (WORKTREE/.copilot/agents)
|
||||
# and the committed, reviewable location (WORKTREE/.github/agents).
|
||||
candidate_roots = [WORKTREE / ".copilot", WORKTREE / ".github"]
|
||||
# Validate only the canonical local-generation cache (WORKTREE/.copilot/agents).
|
||||
# Committed artifact validation (e.g., .github/agents) is out of scope for this
|
||||
# tooling-only change and should be handled in a separate governance + CI PR.
|
||||
candidate_roots = [WORKTREE / ".copilot"]
|
||||
found_any = False
|
||||
for root in candidate_roots:
|
||||
agents_dir = root / "agents"
|
||||
|
||||
Reference in New Issue
Block a user