Answer stability round 2: 0 🔴, 1 🟡 (0 misread); the hand-cut steps and the reused tag's refusal list the exact entries, and a hand cut reruns to the end
CI / tests (pull_request) Has been cancelled

This commit is contained in:
Lilleman
2026-11-24 15:35:08 +01:00
parent 0a38f99a8d
commit a1e6791cdb
2 changed files with 23 additions and 4 deletions
+19 -1
View File
@@ -578,6 +578,24 @@ class Cut(unittest.TestCase):
self.assertEqual(self.forge_state()["calls"], [])
self.assertEqual(self.origin_git("tag", "-l", "v0.1.1"), "")
def test_a_rerun_merges_back_and_deploys_a_patch_cut_by_hand_as_the_refusal_says(self):
self.commit({"tool.txt": "half fixed\n"}, "Change tool.txt on main")
commits = self.plan_patch()
refused = self.cut_patch(commits)
self.assertEqual(refused.returncode, 1)
self.assertIn("exactly these lines:\n- Fixed.", refused.stderr)
self.git(self.clone, "switch", "-q", "--detach", "v0.1.0")
self.commit({"tool.txt": "fixed\n", "CHANGELOG.md": "# Changelog\n\n## 0.1.1\n\n- Fixed.\n\n## 0.1.0\n\n- First.\n"}, "Cut release 0.1.1")
self.git(self.clone, "tag", "-a", "v0.1.1", "-m", "Cut release 0.1.1")
self.git(self.clone, "push", "-q", "origin", "v0.1.1")
self.git(self.clone, "switch", "-q", "main")
tagged = self.origin_git("rev-parse", "v0.1.1^{commit}")
ran = self.cut_patch(commits)
self.assertEqual(ran.returncode, 0, ran.stderr)
self.assertEqual(self.origin_git("rev-parse", "v0.1.1^{commit}"), tagged)
self.origin_git("merge-base", "--is-ancestor", "v0.1.1", "main")
self.assertEqual(self.git(self.target, "describe", "--tags", "--exact-match", "HEAD").strip(), "v0.1.1")
def test_a_rerun_refuses_a_pushed_tag_cut_from_other_commits(self):
self.set_checks("failure")
commits = self.plan_patch()
@@ -587,7 +605,7 @@ class Cut(unittest.TestCase):
self.set_checks("success")
ran = self.cut_patch("HEAD")
self.assertEqual(ran.returncode, 1)
self.assertIn("other changelog entries", ran.stderr)
self.assertIn("The tag lists:\n- Fixed.\nThe commits added:\n- Fixed twice.", ran.stderr)
self.assertNotIn("Fixed twice", self.origin_git("show", "main:CHANGELOG.md").split("## 0.1.0")[0].split("## Unreleased")[0])
def test_refuses_commits_that_add_no_changelog_entry_under_unreleased(self):