Test who merges at each default, a failed ready mark, the worker's sentence and an unreadable config
CI / tests (pull_request) Failing after 4m43s

This commit is contained in:
Lilleman
2026-11-19 16:29:31 +01:00
parent 144986e671
commit 84a0f1d1be
3 changed files with 23 additions and 1 deletions
+10
View File
@@ -12,6 +12,7 @@ import unittest
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
from chunk_pr.main import cleaned, merged, QUEUE, step, turn, USAGE
from chunk_pr.approval import awaited
from failure import Failure
from test_env import isolated_env
from project_config.settings import ProjectConfig
@@ -395,6 +396,15 @@ class Merge(unittest.TestCase):
self.assertIn("awaits a person's merge", str(step(["merge"], checkout, checkout.config)))
self.assertNotIn(GH_DECISION, checkout.ran)
def test_merge_waits_for_no_approval_where_a_person_merges_and_for_the_configs_otherwise(self):
self.assertEqual([awaited("gh", True, True), awaited("tea", True, True), awaited("gh", True), awaited("gh", False)], [False, False, True, False])
self.assertIsInstance(awaited("tea", True), Failure)
def test_under_a_humans_merge_a_pull_request_that_cannot_be_marked_ready_fails_saying_why(self):
checkout = self.merged_by_a_human()
checkout.answers[("gh", "pr", "ready", "12")] = Failure("gh pr ready failed")
self.assertEqual(step(["merge"], checkout, checkout.config), Failure("gh pr ready failed"))
def test_under_a_humans_merge_the_plan_items_are_finished_on_the_branch_so_they_land_with_the_merge(self):
checkout = self.merged_by_a_human()
done = step(["merge", "--finish", "7", "--no-changelog"], checkout, checkout.config)