feat(release): 在原需求单自动准备并登记验收候选
build / build (push) Successful in 2m14s

This commit is contained in:
姚章浩
2026-11-24 19:03:28 +08:00
parent a3dcaa2f5b
commit e6a9acc32c
6 changed files with 70 additions and 63 deletions
+15
View File
@@ -23,6 +23,21 @@ class CandidateReleaseTest(unittest.TestCase):
for n, sha in ((20, A), (21, B))}
self.report = {'actor': {'id': OWNER}, 'createdAt': '2026-11-01T11:00:00Z', 'id': OWNER}
def test_one_requirement_owns_its_own_release(self):
plan = dict(self.plan, items=[{'task': TASK, 'commit': B}], extra=[A])
candidate.check_scope(plan, self.prs.__getitem__, [A, B])
with self.assertRaises(cd.CDError):
candidate.check_plan(dict(plan, items=plan['items'] + [{'task': QA2, 'pr': 20}]))
def test_single_report_covers_business_and_batch(self):
plan = dict(self.plan, items=[{'task': TASK, 'commit': B}], extra=[A])
report = self.result()
for missing in ({}, {'business': ['C-001']}, {'business': [], 'regression': ['R-001']}):
with self.assertRaises(cd.CDError):
candidate.check_qa(plan, RUN, {TASK: (self.report, dict(report, cases=missing))}, {OWNER})
complete = dict(report, cases={'business': ['C-001'], 'regression': ['R-001']}, required=2, passed=2)
candidate.check_qa(plan, RUN, {TASK: (self.report, complete)}, {OWNER})
def test_scope_accounts_for_entire_main_range(self):
candidate.check_scope(self.plan, self.prs.__getitem__, [A, B])
with self.assertRaisesRegex(cd.CDError, 'outside the release scope'):