aboutsummaryrefslogtreecommitdiffziptar.gz
path: root/tests/test_split.py
diff options
context:
space:
mode:
authorgodosa <godosa@godosa.eu>2026-10-07 09:37:36 +0200
committergodosa <godosa@godosa.eu>2026-10-07 09:37:36 +0200
commit811de09feb866c5b344034399154bde77acdd5ba (patch)
tree81bd100b71b883192970c40395954a49f9a9eaff /tests/test_split.py
parent4743282cde2cd3d6ec767e93564b2121c6d643e4 (diff)
downloadworkflow-811de09feb866c5b344034399154bde77acdd5ba.tar.gz
workflow-811de09feb866c5b344034399154bde77acdd5ba.zip
split projects 5/6: wf orch pick/post use the code repo; push-failed stops the lane
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2
Diffstat (limited to 'tests/test_split.py')
-rw-r--r--tests/test_split.py27
1 files changed, 27 insertions, 0 deletions
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())