From 811de09feb866c5b344034399154bde77acdd5ba Mon Sep 17 00:00:00 2001 From: godosa Date: Wed, 7 Oct 2026 09:37:36 +0200 Subject: split projects 5/6: wf orch pick/post use the code repo; push-failed stops the lane Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2 --- tests/test_split.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/test_split.py b/tests/test_split.py index 4182ce4..965f667 100644 --- a/tests/test_split.py +++ b/tests/test_split.py @@ -231,3 +231,30 @@ class PushSplitTest(SplitCli): project=False, cwd=self.wt, env=IDENT) self.assertEqual(code, 0, out + err) self.assertEqual((self.root / "pushed-from.txt").read_text().strip(), str(self.root)) + + +class OrchSplitTest(SplitCli): + def setUp(self): + super().setUp() + self.wf("set", "t-three", "--model", "sonnet", "--done", "x") + + def test_pick_worktree_in_code_repo(self): + code, out, err = self.wf("orch", "pick", "fast", "--id", "t-three", project=False, env=IDENT) + self.assertEqual(code, 0, out + err) + self.assertIn(f"Main tree: {self.root} Worktree: {self.code / '.worktrees' / 'fast'} Branch: fast/t-three", out) + + def test_post_done_checks_code_branch_and_stops_on_push_failed(self): + self.wf("orch", "pick", "fast", "--id", "t-three", project=False, env=IDENT) + wt = self.code / ".worktrees" / "fast" + self.wf("start", "t-three", "--worktree", str(wt), "--branch", "fast/t-three", project=False, env=IDENT) + (wt / "code.txt").write_text("x\n") + (self.root / "workflow.toml").write_text(SplitCli.toml + 'push = ["exit 1"]\n') + code, out, err = self.wf("finish", "t-three", "-m", "ok", "--commit", "impl", "code.txt", + project=False, cwd=wt, env=IDENT) + self.assertEqual(code, 0, out + err) + code, out, err = self.wf("orch", "post", "t-three", "fast", "--result", "done", project=False, env=IDENT) + self.assertEqual(code, 0, out + err) + self.assertIn("post: t-three push-failed", out) + self.assertIn("stop lane fast: push-failed", out) + self.assertNotIn("branch fast/t-three still there", out) + self.assertIn(f" {self.sha(self.code)} ", (self.root / "out" / "wf-orch.log").read_text()) -- cgit