headroom/e2e/__init__.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
191 B
Python
Raw Normal View History

test(init): extend Docker e2e with bare/shim/per-subcommand cases Port e2e/init/run.py onto the shared harness and extend coverage so issue #245 (bare ``headroom init -g`` with no agents) is locked in: * ``seq_claude_local`` / ``seq_copilot_global`` / ``seq_codex_local`` — the original scenario, now expressed as a sequence of Cases sharing one scratch so the manifest-merge behavior (claude + codex targets) is still exercised end-to-end * ``bare_init_g_no_shims`` — regression guard for issue #245: asserts the new guided error mentions every probed target and the concrete ``headroom init -g <agent>`` example * ``bare_init_g_with_all_shims`` — complementary happy path with all four shims present; asserts all three configurable agents report ``Configured ... (user scope)`` on stdout * ``init_g_{claude,codex,copilot}_explicit`` — one case per subcommand, each with only its own shim on PATH, asserting exit 0 and the correct per-agent settings file is written * ``init_g_openclaw_missing`` — negative path for openclaw when its binary isn't installed (delegates to ``headroom wrap openclaw`` which can't be shimmed cheaply) * ``init_verbose_no_shims`` — smoke test for ``headroom init -v`` ensuring ``detect_init_targets``, ``global_scope=True``, and every agent name appear on stderr Dockerfile is updated to COPY e2e/__init__.py and e2e/_lib/ so the harness is importable inside the container. A new e2e/__init__.py marks the tree as a package. One small harness fix rides along: ``_resolve_headroom_bin`` captures the absolute path to headroom before ``with_clean_path`` narrows PATH. This is required for any case run inside a venv-scoped image - the real ``headroom`` lives outside the shim dir and would otherwise be hidden by the scrubbed PATH. Same bug would have bitten every future command suite, so the fix belongs in the harness rather than run.py. Verified locally inside the Docker image: all 10 cases pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 16:12:27 -05:00
"""End-to-end test suites for Headroom CLI commands.
Subpackages:
_lib shared harness and helpers
init ``headroom init`` coverage
wrap ``headroom wrap`` coverage
"""