Keep configs in ~/.config/build-release/ and tool state in ~/.local/state/build-release/, under XDG_* where set
CI / tests (pull_request) Successful in 6m34s
CI / tests (pull_request) Successful in 6m34s
This commit is contained in:
@@ -102,7 +102,7 @@ class ClosingTheEpic(DoEpicTest):
|
||||
def close(self, summary: str = "## Shipped\n\napi: the import.\n") -> tuple[int, str, str]:
|
||||
out, err = io.StringIO(), io.StringIO()
|
||||
with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err):
|
||||
code = main.main(["ABC-12", "--close-epic"], {}, paths_from(self.home), LAUNCHER, FakeEffects().effects(), self.backend, io.StringIO(summary))
|
||||
code = main.main(["ABC-12", "--close-epic"], {}, paths_from(self.home, {}), LAUNCHER, FakeEffects().effects(), self.backend, io.StringIO(summary))
|
||||
return code, out.getvalue(), err.getvalue()
|
||||
|
||||
def test_posts_the_summary_on_the_epic_and_closes_it(self) -> None:
|
||||
@@ -127,15 +127,15 @@ class ClosingTheEpic(DoEpicTest):
|
||||
self.assertEqual(finish.closed("ABC-12", Unreadable("ABC-12", list(REVIEWED)), {}, io.StringIO("Shipped.")), Failure("cannot close the epic ABC-12: Jira answered 503"))
|
||||
|
||||
def test_the_jira_backend_closes_an_epic_by_the_transition_the_settings_name(self) -> None:
|
||||
with open(self.home / ".claude-projects/do-epic/config.toml", "a", encoding="utf-8") as settings:
|
||||
with open(self.home / ".config/build-release/do-epic/config.toml", "a", encoding="utf-8") as settings:
|
||||
settings.write('jira-finish-transition = "Mark as done"\njira-finish-status = "Done"\n')
|
||||
config = load(self.home)
|
||||
config = load(self.home, {})
|
||||
assert isinstance(config, DoEpicConfig), config
|
||||
store, _ = main.jira_backend(config, "ABC-12")
|
||||
self.assertEqual(store.finish, Finish("Mark as done", "Done")) # type: ignore[attr-defined]
|
||||
|
||||
def test_closes_an_epic_whose_open_issues_all_have_the_merged_status(self) -> None:
|
||||
(self.home / ".claude-projects" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-unblocking-statuses = ["Release Ready"]\njira-pull-request-merged-status = "Release Ready"\n', encoding="utf-8")
|
||||
(self.home / ".config/build-release" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-unblocking-statuses = ["Release Ready"]\njira-pull-request-merged-status = "Release Ready"\n', encoding="utf-8")
|
||||
self.issues.append(issue("ABC-31", "repo:api", status="Release Ready"))
|
||||
code, out, err = self.close()
|
||||
self.assertEqual(code, 0, err)
|
||||
@@ -201,7 +201,7 @@ class TheFinishingChunk(DoEpicTest):
|
||||
self.assertIn(["/b/do-epic", "--chunk", "ABC-12", "ABC-12"], [args[-4:] for args in fake.tmux_calls])
|
||||
|
||||
def test_starts_once_each_open_issue_has_the_merged_status(self) -> None:
|
||||
(self.home / ".claude-projects" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-unblocking-statuses = ["Release Ready"]\njira-pull-request-merged-status = "Release Ready"\n', encoding="utf-8")
|
||||
(self.home / ".config/build-release" / "do-epic" / "config.toml").write_text(SETTINGS + 'jira-unblocking-statuses = ["Release Ready"]\njira-pull-request-merged-status = "Release Ready"\n', encoding="utf-8")
|
||||
self.issues = [issue("ABC-20", "do-epic-claude", status="Release Ready"), issue("ABC-21", "do-epic-claude", done=True)]
|
||||
fake = FakeEffects(on_terminal=False)
|
||||
code, out, err = self.run_main(["ABC-12"], fake)
|
||||
@@ -227,7 +227,7 @@ class TheFinishingChunk(DoEpicTest):
|
||||
|
||||
def test_its_worker_is_handed_the_finishing_task_and_runs_until_the_judge_rules_it_finished(self) -> None:
|
||||
self.issues = list(REVIEWED)
|
||||
worker = Worker(paths_from(self.home).claude_code_transcripts.parent)
|
||||
worker = Worker(paths_from(self.home, {}).claude_code_transcripts.parent)
|
||||
fake = FakeEffects(streams=[worker], claude=[judged("finished")], git=UNREAD, windows="ABC-12\t0\t@9\n")
|
||||
code, out, err = self.run_main(["--chunk", "ABC-12", "ABC-12"], fake, MODELS)
|
||||
self.assertEqual(code, 0, err)
|
||||
@@ -237,11 +237,11 @@ class TheFinishingChunk(DoEpicTest):
|
||||
self.assertIn("`/b/do-epic ABC-12 --close-epic`", streamed)
|
||||
self.assertIn("From the epic ABC-12's description:\n## Goals\nShip the import.", streamed)
|
||||
self.assertIn("write a summary in English, the epic's language", streamed)
|
||||
self.assertTrue((self.home / ".local/state/do-epic/ABC-12").is_dir())
|
||||
self.assertTrue((self.home / ".local/state/build-release/do-epic/ABC-12").is_dir())
|
||||
|
||||
def test_a_worker_that_resumes_is_told_the_task_as_the_epic_now_stands(self) -> None:
|
||||
self.issues = list(REVIEWED)
|
||||
transcripts = paths_from(self.home).claude_code_transcripts
|
||||
transcripts = paths_from(self.home, {}).claude_code_transcripts
|
||||
worker = Worker(transcripts.parent)
|
||||
session = session_named("A ABC-12 do-epic ABC-12", transcripts)
|
||||
(transcripts / "-fake").mkdir(parents=True)
|
||||
@@ -256,7 +256,7 @@ class TheFinishingChunk(DoEpicTest):
|
||||
|
||||
def test_stops_where_the_epics_issues_cannot_be_read_or_its_lock_cannot_be_taken(self) -> None:
|
||||
self.issues = [issue("ABC-20", "do-epic-claude", done=True)]
|
||||
(self.home / ".local/state/do-epic/ABC-12" / LOCK).mkdir(parents=True)
|
||||
(self.home / ".local/state/build-release/do-epic/ABC-12" / LOCK).mkdir(parents=True)
|
||||
code, _, err = self.run_main(["ABC-12"], FakeEffects(on_terminal=False))
|
||||
self.assertEqual(code, 1)
|
||||
self.assertIn("cannot lock ", err)
|
||||
|
||||
Reference in New Issue
Block a user