default profile falls back to built-in defaults

This commit is contained in:
hermes committed 2026-11-13 18:22:33 +00:00
1 parent b2d72f2dc9
commit 193c6cd9eb
3 files changed
+21 -2

No files matched your search

+11
View File
@@ -316,6 +316,17 @@ shutil.copytree(ev, broken)
bad = subprocess.run([orch, "bench", str(broken), "--check"], env=env, capture_output=True, text=True)
assert bad.returncode == 1 and "broken case" in bad.stdout, bad
# --- no profile file: `default` falls back to built-in defaults, other names still fail ---
nocfg = {**env, "ORCH_CONFIG_DIR": str(tmp / "no-cfg"), "FAKE_VERSION": "0"}
(tmp / "bin").mkdir(exist_ok=True)
hxw = tmp / "bin/hx"
hxw.write_text(f"#!/bin/sh\nexec {sys.executable} {fake} \"$@\"\n")
hxw.chmod(0o755)
nb = subprocess.run([orch, "bench", str(ev), "--case", "fix-typo-readme", "--out", str(tmp / "nb.jsonl")], env={**nocfg, "PATH": f"{tmp / 'bin'}:{os.environ['PATH']}", "SOLVE_DIR": str(ev)}, capture_output=True, text=True)
assert nb.returncode == 1 and (tmp / "nb.jsonl").exists() and "default.toml" not in nb.stderr, nb # hx ran (unsolved: SOLVE_DIR is filtered from its env), no missing-profile error
miss = subprocess.run([orch, "bench", str(ev), "--profile", "typo"], env=nocfg, capture_output=True, text=True)
assert miss.returncode != 0 and "typo.toml" in miss.stderr, miss
# kill orch mid-run: status must say interrupted and hx must be dead after the next orch call
pidfile = tmp / "hx.pid"
p = subprocess.Popen([orch, "run", str(task("killed", "HANG")), "--repo", str(repo), "--profile", "p"],