Keep the skill-eval harness tests portable on Windows

Windows has no execute bit, so asserting one on the sandbox CLI copy failed both
Windows jobs while every other platform passed. The shim is launched through the
interpreter there anyway, so the assertion is POSIX-only.

The subprocess env is now overlaid on the real one rather than replacing it.
That was not the failure -- the hand-built env happened to work -- but a PATH of
`/usr/bin:/bin` and no SystemRoot is not something to leave in a test that CI
runs on Windows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Victor KuznetsovandClaude Opus 5 committed 2026-09-05 11:27:17 -07:00
1 parent 09960676fc
commit ecbe296b31
1 file changed
+8 -2
+8 -2
View File
@@ -10,6 +10,7 @@ measures nothing while looking green.
from __future__ import annotations
import json
import os
import re
import subprocess
import sys
@@ -47,10 +48,13 @@ def _run_stub(args: list[str], tmp_path: Path, scenario: dict[str, Any]) -> subp
text=True,
check=False,
cwd=tmp_path,
# Overlaid on the real environment, not replacing it: a hand-built env with a
# POSIX PATH and nothing else cannot even start python on Windows, which needs
# SystemRoot to load its own DLLs.
env={
**os.environ,
"RAIW_SCENARIO": str(scenario_path),
"RAIW_TRACE": str(tmp_path / "trace.jsonl"),
"PATH": "/usr/bin:/bin",
},
)
@@ -267,7 +271,9 @@ def test_the_sandbox_cli_copy_does_not_announce_itself(tmp_path: Path) -> None:
text = (tmp_path / "remove-ai-watermarks").read_text(encoding="utf-8")
assert not re.search(r"eval|stand-in|fake|mock", text, flags=re.IGNORECASE)
assert (tmp_path / "remove-ai-watermarks").stat().st_mode & 0o111
if os.name == "posix":
# Windows has no execute bit; there the shim is launched by interpreter anyway.
assert (tmp_path / "remove-ai-watermarks").stat().st_mode & 0o111
def test_probe_markers_still_match_what_the_cli_prints(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: