Rename loop-claude to build-release, with no alias
This commit is contained in:
@@ -155,14 +155,14 @@ class WhichIssuesAreChunks(unittest.TestCase):
|
||||
|
||||
|
||||
class RoomInARepo(unittest.TestCase):
|
||||
def test_a_repo_with_room_and_no_loop_claude_takes_a_chunk(self) -> None:
|
||||
self.assertIsNone(refusal("api", RepoRoom(limit=2, running=1, loop_claude=False)))
|
||||
def test_a_repo_with_room_and_no_build_release_takes_a_chunk(self) -> None:
|
||||
self.assertIsNone(refusal("api", RepoRoom(limit=2, running=1, build_release=False)))
|
||||
|
||||
def test_a_full_repo_takes_none(self) -> None:
|
||||
self.assertEqual(refusal("api", RepoRoom(limit=2, running=2, loop_claude=False)), "api runs as many chunks as its `parallel-chunks` allows: 2")
|
||||
self.assertEqual(refusal("api", RepoRoom(limit=2, running=2, build_release=False)), "api runs as many chunks as its `parallel-chunks` allows: 2")
|
||||
|
||||
def test_a_repo_loop_claude_runs_chunks_in_takes_none(self) -> None:
|
||||
self.assertEqual(refusal("api", RepoRoom(limit=2, running=0, loop_claude=True)), "loop-claude runs chunks in api")
|
||||
def test_a_repo_build_release_runs_chunks_in_takes_none(self) -> None:
|
||||
self.assertEqual(refusal("api", RepoRoom(limit=2, running=0, build_release=True)), "build-release runs chunks in api")
|
||||
|
||||
|
||||
class Tmux:
|
||||
@@ -210,7 +210,7 @@ class StartingAnEpicsChunks(unittest.TestCase):
|
||||
"""An epic whose repos are checked out under the home folder, each with its `parallel-chunks`."""
|
||||
def locate(name: str) -> tuple[pathlib.Path, int] | Failure:
|
||||
return (self.home / "code" / name, limits[name]) if name in limits else Failure(f"no project config names {name}")
|
||||
return Epic("ABC-12", cap, locate, self.home, pathlib.Path("/bin/do-epic"), {"LOOP_CLAUDE_X": "1", "OTHER": "2"}, {}, self.order)
|
||||
return Epic("ABC-12", cap, locate, self.home, pathlib.Path("/bin/do-epic"), {"BUILD_RELEASE_X": "1", "OTHER": "2"}, {}, self.order)
|
||||
|
||||
def start(self, epic: Epic, issues: list[EpicIssue], run: Tmux, own: str | None = None) -> Started:
|
||||
found = start_chunks(epic, issues, False, own, run)
|
||||
@@ -223,7 +223,7 @@ class StartingAnEpicsChunks(unittest.TestCase):
|
||||
self.assertEqual(found, Started(["ABC-20", "ABC-21"], [Waits("ABC-22", "the epic runs as many chunks as its `**Max parallel chunks:**` line allows: 2")]))
|
||||
self.assertEqual(run.started(), [("epic-ABC-12", "ABC-20", f"{CHUNK_FLAG} ABC-20 ABC-12"), ("epic-ABC-12", "ABC-21", f"{CHUNK_FLAG} ABC-21 ABC-12")])
|
||||
self.assertEqual([args[args.index("-c") + 1] for args in run.calls if args[0] in ("new-session", "new-window")], [str(self.home / "code/api"), str(self.home / ".local/state/do-epic/ABC-12")])
|
||||
self.assertIn("LOOP_CLAUDE_X=1", run.calls[[args[0] for args in run.calls].index("new-session")])
|
||||
self.assertIn("BUILD_RELEASE_X=1", run.calls[[args[0] for args in run.calls].index("new-session")])
|
||||
self.assertNotIn("OTHER=2", run.calls[[args[0] for args in run.calls].index("new-session")])
|
||||
|
||||
def parked(self, issue_key: str, on: str = "an approval") -> None:
|
||||
@@ -325,7 +325,7 @@ class StartingAnEpicsChunks(unittest.TestCase):
|
||||
cases = {
|
||||
"the epic runs as many chunks as its `**Max parallel chunks:**` line allows: 1": (self.epic(1, api=2), Tmux(parked, ("epic-ABC-12", "ABC-21", False, str(self.home / "code/web")))),
|
||||
"api runs as many chunks as its `parallel-chunks` allows: 1": (self.epic(2, api=1), Tmux(parked, ("epic-XYZ-1", "XYZ-5", False, str(self.home / "code/api")))),
|
||||
"loop-claude runs chunks in api": (self.epic(2, api=1), Tmux(parked, ("loop-api", "item-3", False, str(self.home / "code/api")), owners={"loop-api": str(self.home / "code/api")})),
|
||||
"build-release runs chunks in api": (self.epic(2, api=1), Tmux(parked, ("loop-api", "item-3", False, str(self.home / "code/api")), owners={"loop-api": str(self.home / "code/api")})),
|
||||
"no project config names api": (self.epic(2), Tmux(parked)),
|
||||
}
|
||||
for reason, (epic, run) in cases.items():
|
||||
@@ -346,14 +346,14 @@ class StartingAnEpicsChunks(unittest.TestCase):
|
||||
def test_a_chunk_its_repo_refuses_takes_no_slot_of_the_epics_cap(self) -> None:
|
||||
run = Tmux(("loop-api", "item-3", False, str(self.home / "code/api")), owners={"loop-api": str(self.home / "code/api")})
|
||||
found = self.start(self.epic(1, api=1, web=1), [issue("ABC-20", "repo:api"), issue("ABC-21", "repo:web")], run)
|
||||
self.assertEqual(found, Started(["ABC-21"], [Waits("ABC-20", "loop-claude runs chunks in api")]))
|
||||
self.assertEqual(found, Started(["ABC-21"], [Waits("ABC-20", "build-release runs chunks in api")]))
|
||||
|
||||
def test_never_starts_in_a_repo_loop_claude_runs_chunks_in(self) -> None:
|
||||
def test_never_starts_in_a_repo_build_release_runs_chunks_in(self) -> None:
|
||||
run = Tmux(("loop-api", "item-3", False, str(self.home / "code/api")), owners={"loop-api": str(self.home / "code/api")})
|
||||
found = self.start(self.epic(3, api=2), [issue("ABC-20", "repo:api")], run)
|
||||
self.assertEqual(found, Started([], [Waits("ABC-20", "loop-claude runs chunks in api")]))
|
||||
self.assertEqual(found, Started([], [Waits("ABC-20", "build-release runs chunks in api")]))
|
||||
|
||||
def test_a_stopped_loop_claude_window_keeps_no_repo(self) -> None:
|
||||
def test_a_stopped_build_release_window_keeps_no_repo(self) -> None:
|
||||
run = Tmux(("loop-api", "item-3", True, str(self.home / "code/api")), owners={"loop-api": str(self.home / "code/api")})
|
||||
self.assertEqual(self.start(self.epic(3, api=2), [issue("ABC-20", "repo:api")], run).started, ["ABC-20"])
|
||||
|
||||
@@ -371,7 +371,7 @@ class StartingAnEpicsChunks(unittest.TestCase):
|
||||
found = self.start(self.epic(1, api=1), [issue("ABC-20", "repo:api"), issue("ABC-21", "repo:api"), issue("ABC-22", "repo:api")], run, own="ABC-20")
|
||||
self.assertEqual(found, Started(["ABC-22"], [Waits("ABC-21", "its window stopped; run `do-epic ABC-12` to start it again")]))
|
||||
|
||||
def test_holds_each_repos_starting_lock_that_loop_claude_holds(self) -> None:
|
||||
def test_holds_each_repos_starting_lock_that_build_release_holds(self) -> None:
|
||||
self.start(self.epic(1, api=1), [issue("ABC-20", "repo:api")], Tmux())
|
||||
self.assertTrue((self.home / ".local/state/loop-claude/api/starting").is_file())
|
||||
self.assertTrue((self.home / ".local/state/do-epic/ABC-12/starting").is_file())
|
||||
|
||||
Reference in New Issue
Block a user