Keep the host's claude off the black-box tests' PATH
This commit is contained in:
@@ -149,6 +149,7 @@ class Checkout:
|
||||
fake.mkdir()
|
||||
(fake / "claude").write_text(FAKE_CLAUDE.format(python=sys.executable))
|
||||
(fake / "claude").chmod(0o755)
|
||||
(fake / "git").symlink_to(shutil.which("git"))
|
||||
site = self.temp / "site"
|
||||
site.mkdir()
|
||||
(site / "sitecustomize.py").write_text(SITECUSTOMIZE)
|
||||
@@ -161,7 +162,7 @@ class Checkout:
|
||||
"LOOP_CLAUDE_JUDGE_MODEL": "judge-model",
|
||||
"LOOP_CLAUDE_WORKER_MODEL": "worker-model",
|
||||
"LOOP_TEST_LOG": str(self.temp / "starts.jsonl"),
|
||||
"PATH": f"{fake}{os.pathsep}{os.environ['PATH']}",
|
||||
"PATH": str(fake),
|
||||
"PYTHONPATH": str(site),
|
||||
})
|
||||
self.git("init", "--quiet")
|
||||
@@ -355,10 +356,7 @@ class Cycles(unittest.TestCase):
|
||||
|
||||
def test_retries_a_worker_claude_cannot_start(self):
|
||||
checkout = Checkout(self)
|
||||
only_git = checkout.temp / "only-git"
|
||||
only_git.mkdir()
|
||||
(only_git / "git").symlink_to(shutil.which("git"))
|
||||
checkout.env["PATH"] = str(only_git)
|
||||
(checkout.temp / "fake-bin" / "claude").unlink()
|
||||
run = checkout.run([])
|
||||
self.assertEqual((run.code, run.calls), (1, []))
|
||||
self.assertEqual(run.sleeps, [60, 60])
|
||||
|
||||
Reference in New Issue
Block a user