Skip to content

Windows: env-fault engine test replays check.sh through cmd — pops the 'How do you want to open this file?' dialog on every local full-suite run #292

Description

@dracic

Summary

tests/test_engine.py::test_fix_phase_session_env_fault_escalates builds a POSIX verify script (check.sh with a #!/bin/sh shebang) and puts "<path>/check.sh" into VerifyPolicy(commands=...). The engine runs verify commands through the host shell — cmd /c on Windows — and cmd hands a document path to ShellExecute. On a machine with no .sh association (stock Windows), that pops the interactive "How do you want to open this file?" picker in the middle of the test run.

Its three sibling tests in the same file (test_review_verify_env_fault_escalates_instead_of_fix_session, test_skip_review_env_fault_escalates_not_defers, test_fix_phase_env_fault_escalates_instead_of_looping) all carry @pytest.mark.skipif(sys.platform == "win32", ...); this one does not.

Why it goes unnoticed

The test still passes on Windows — the fault it asserts comes from the injected SessionResult(env_fault=True), not from the script's exit code — so CI stays green and nothing flags it. The only symptom is a GUI dialog stealing focus on every local full-suite run (observed on Windows 11 during the #254 verification runs; confirmed root cause via cmd /c assoc .sh → "File association not found").

Suggested fix

The test's subject (#194: a fix session that lost its API connection escalates instead of burning dev budget) is not POSIX-specific, so a skip would lose real Windows coverage. Prefer a per-OS script, mirroring the platform split tests/conftest.py already uses for verify commands:

if sys.platform == "win32":
    script = project.project / "check.cmd"
    script.write_text("@exit 0\r\n", encoding="utf-8")
else:
    script = project.project / "check.sh"
    script.write_text("#!/bin/sh\nexit 0\n", encoding="utf-8")
    script.chmod(0o755)

Refs: #194

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions