mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-15 08:18:19 +00:00
rc-bugs policy: Ignored bugs are not unique to testing
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
d7f6a00a51
commit
fc2269ba02
@ -478,6 +478,7 @@ class RCBugPolicy(BasePolicy):
|
||||
continue
|
||||
if not ignored_bugs.isdisjoint(bugs_u):
|
||||
bugs_u -= ignored_bugs
|
||||
bugs_t -= ignored_bugs
|
||||
rcbugs_info['ignored-bugs'] = {
|
||||
'bugs': sorted(ignored_bugs),
|
||||
'issued-by': ignore_hint.user
|
||||
|
@ -1,2 +1,3 @@
|
||||
fixes-bug 123456
|
||||
not-a-regression 123457
|
||||
regression-but-fixes-more-bugs 100000,100001,100002
|
||||
|
@ -1,2 +1,3 @@
|
||||
not-a-regression 123457
|
||||
regression 123458
|
||||
regression-but-fixes-more-bugs 100000,100003
|
||||
|
@ -80,6 +80,16 @@ class TestRCBugsPolicy(unittest.TestCase):
|
||||
assert set(policy_info['rc-bugs']['unique-target-bugs']) == set()
|
||||
assert set(policy_info['rc-bugs']['shared-bugs']) == set()
|
||||
|
||||
def test_regression_but_fixes_more_bugs(self):
|
||||
src_name = 'regression-but-fixes-more-bugs'
|
||||
src_t, src_u, excuse, policy_info = create_policy_objects(src_name, '1.0', '2.0')
|
||||
policy = initialize_policy('rc-bugs/basic', RCBugPolicy)
|
||||
verdict = policy.apply_policy(policy_info, 'unstable', src_name, src_t, src_u, excuse)
|
||||
assert verdict == PolicyVerdict.REJECTED_PERMANENTLY
|
||||
assert set(policy_info['rc-bugs']['unique-source-bugs']) == {'100003'}
|
||||
assert set(policy_info['rc-bugs']['unique-target-bugs']) == {'100001', '100002'}
|
||||
assert set(policy_info['rc-bugs']['shared-bugs']) == {'100000'}
|
||||
|
||||
def test_not_a_regression(self):
|
||||
src_name = 'not-a-regression'
|
||||
src_t, src_u, excuse, policy_info = create_policy_objects(src_name, '1.0', '2.0')
|
||||
@ -113,5 +123,19 @@ class TestRCBugsPolicy(unittest.TestCase):
|
||||
assert set(policy_info['rc-bugs']['unique-target-bugs']) == set()
|
||||
assert set(policy_info['rc-bugs']['shared-bugs']) == set()
|
||||
|
||||
def test_regression_but_fixes_more_bugs_bad_hint(self):
|
||||
src_name = 'regression-but-fixes-more-bugs'
|
||||
hints = ['ignore-rc-bugs 100000 regression-but-fixes-more-bugs/2.0']
|
||||
src_t, src_u, excuse, policy_info = create_policy_objects(src_name, '1.0', '2.0')
|
||||
policy = initialize_policy('rc-bugs/basic', RCBugPolicy, hints=hints)
|
||||
verdict = policy.apply_policy(policy_info, 'unstable', src_name, src_t, src_u, excuse)
|
||||
assert verdict == PolicyVerdict.REJECTED_PERMANENTLY
|
||||
print(str(policy_info['rc-bugs']))
|
||||
assert set(policy_info['rc-bugs']['unique-source-bugs']) == {'100003'}
|
||||
assert set(policy_info['rc-bugs']['unique-target-bugs']) == {'100001', '100002'}
|
||||
assert set(policy_info['rc-bugs']['ignored-bugs']['bugs']) == {'100000'}
|
||||
assert policy_info['rc-bugs']['ignored-bugs']['issued-by'] == TEST_HINTER
|
||||
assert set(policy_info['rc-bugs']['shared-bugs']) == set()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user