Add duplicate bug detection to skip_tracker.py
Previously, if a tempest test was skipped because of a bug that
was marked a duplicate of another bug the skip tracker would not
check the status of the duplicate bug. This would cause fixed bugs
from being shown up in the list, because the original bug's status
is not necessarily updated if it is marked as a duplicate.
This commit fixes this behavior by checking if there is a duplicate
bug first. Then after all the bugs' statuses are checked the list of
duplicate bugs is checked. If a duplicate bug is marked as fixed the
original bug is added to list of bugs that is safe to unskip.
Change-Id: Ia1aaec9e01a97556d17b0640a95e03f0f0b37680
diff --git a/tools/skip_tracker.py b/tools/skip_tracker.py
index e890e92..12d29b0 100755
--- a/tools/skip_tracker.py
+++ b/tools/skip_tracker.py
@@ -89,6 +89,7 @@
results = find_skips()
unique_bugs = sorted(set([bug for (method, bug) in results]))
unskips = []
+ duplicates = []
info("Total bug skips found: %d", len(results))
info("Total unique bugs causing skips: %d", len(unique_bugs))
lp = launchpad.Launchpad.login_anonymously('grabbing bugs',
@@ -96,12 +97,26 @@
LPCACHEDIR)
for bug_no in unique_bugs:
bug = lp.bugs[bug_no]
+ duplicate = bug.duplicate_of_link
+ if duplicate is not None:
+ dup_id = duplicate.split('/')[-1]
+ duplicates.append((bug_no, dup_id))
for task in bug.bug_tasks:
info("Bug #%7s (%12s - %12s)", bug_no,
task.importance, task.status)
if task.status in ('Fix Released', 'Fix Committed'):
unskips.append(bug_no)
+ for bug_id, dup_id in duplicates:
+ if bug_id not in unskips:
+ dup_bug = lp.bugs[dup_id]
+ for task in dup_bug.bug_tasks:
+ info("Bug #%7s is a duplicate of Bug#%7s (%12s - %12s)",
+ bug_id, dup_id, task.importance, task.status)
+ if task.status in ('Fix Released', 'Fix Committed'):
+ unskips.append(bug_id)
+
+ unskips = sorted(set(unskips))
if unskips:
print "The following bugs have been fixed and the corresponding skips"
print "should be removed from the test cases:"