From 4adcadcddb9e1b5637c99d1789558e718057acf3 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 12 Nov 2026 06:03:31 +0100 Subject: [PATCH] Pin the replay's progress lines, its limit exit and the comparison without a miss in tests --- bin/review_replay/test_review_replay.py | 11 ++++++++++- bin/review_rules/test_reviewer_context.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/review_replay/test_review_replay.py b/bin/review_replay/test_review_replay.py index 5346c35e..791a148f 100644 --- a/bin/review_replay/test_review_replay.py +++ b/bin/review_replay/test_review_replay.py @@ -273,10 +273,19 @@ class Main(unittest.TestCase): "Without CLAUDE.md it found 1 of them, and missed 1 that it found both times with it:\n" f" {self.checkout} 2026-10-14T10:00:00Z: 🔴 a.txt:1 wrong\n" )) + with_them = f"replaying 1 stability rounds with the instruction files on {REFERENCE}\n" + self.assertEqual(err, with_them * 2 + f"replaying 1 stability rounds without the instruction files on {REFERENCE}\n") + + def test_without_claude_md_says_so_where_the_reviewer_missed_nothing_and_names_a_reviewer_that_printed_no_json(self): + code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]}) + self.assertEqual((code, out.splitlines()[-1]), (0, "Without CLAUDE.md it found 1 of them, and missed 0 that it found both times with it.")) + _, _, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"found": [0]}, review=lambda rung: []) + self.assertIn("found nothing: claude printed no json reply", err) def test_without_claude_md_stops_at_a_usage_limit(self): - code, out, _ = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"type": "result", "api_error_status": 429, "result": "You've hit your limit"}) + code, out, err = self.run_main(["stability", "claude-opus-5-5", "--omit-claude-md"], lambda rung: {"type": "result", "api_error_status": 429, "result": "You've hit your limit"}) self.assertEqual((code, out), (1, "")) + self.assertIn("review-replay: claude hit a usage limit: You've hit your limit", err) self.assertEqual(len(self.reviews), 1) def test_replays_the_models_rounds_on_the_commit_reviewed_from_the_project_rung_down(self): diff --git a/bin/review_rules/test_reviewer_context.py b/bin/review_rules/test_reviewer_context.py index 2c21c774..88a2ed30 100644 --- a/bin/review_rules/test_reviewer_context.py +++ b/bin/review_rules/test_reviewer_context.py @@ -27,7 +27,7 @@ class ReviewerContext(unittest.TestCase): (self.home / ".claude" / "CLAUDE.md").write_text("## Prose\n\nWrite short.\n") self.assertEqual(reviewer_context(self.home), Failure(f"{self.home / '.claude' / 'CLAUDE.md'} holds no section Shared goal, Vocabulary")) (self.home / ".claude" / "CLAUDE.md").unlink() - self.assertIsInstance(reviewer_context(self.home), Failure) + self.assertIn(f"could not read {self.home / '.claude' / 'CLAUDE.md'}: ", reviewer_context(self.home).reason) def test_the_repos_claude_md_holds_each_section(self): headings = [line[3:] for line in (REPO / "CLAUDE.md").read_text().splitlines() if line.startswith("## ")]