def __init__(self, arch, results, args, root_url, progress_browser, bugzilla_browser, test_browser):
"""Construct an archreport object with options."""
self.arch = arch
self.args = args
self.root_url = root_url
self.progress_browser = progress_browser
self.bugzilla_browser = bugzilla_browser
self.test_browser = test_browser
self.status_badge = set_status_badge([i['state'] for i in results.values()])
if self.args.bugrefs and self.args.include_softfails:
self._search_for_bugrefs_for_softfailures(results)
# if a ticket is known and the same refers to a STILL_FAILING scenario and any NEW_ISSUE we regard that as STILL_FAILING but just visible in more
# scenarios, ...
# ... else (no ticket linked) we don't group them as we don't know if it really is the same issue and handle them outside
results_by_bugref = SortedDict(get_results_by_bugref(results, self.args))
self.issues = defaultdict(lambda: defaultdict(list))
for bugref, result_list in iteritems(results_by_bugref):
if not re.match('(poo|bsc|boo)#', bugref):
log.info('Skipping unknown bugref \'%s\' in \'%s\'' % (bugref, result_list))
continue
bug = result_list[0]
issue = Issue(bug['bugref'], bug['bugref_href'], self.args.query_issue_status, self.progress_browser, self.bugzilla_browser)
self.issues[issue_state(result_list)][issue_type(bugref)].append(IssueEntry(self.args, self.root_url, result_list, bug=issue))
# left to handle are the issues marked with 'todo'
todo_results = results_by_bugref.get('todo', [])
new_issues = (r for r in todo_results if r['state'] == 'NEW_ISSUE')
self.issues['new']['todo'].extend(IssueEntry.for_each(self.args, self.root_url, new_issues, test_browser))
existing_issues = (r for r in todo_results if r['state'] == 'STILL_FAILING')
self.issues['existing']['todo'].extend(IssueEntry.for_each(self.args, self.root_url, existing_issues, test_browser))
if self.args.include_softfails:
new_soft_fails = [r for r in todo_results if r['state'] == 'NEW_SOFT_ISSUE']
existing_soft_fails = [r for r in todo_results if r['state'] == 'STILL_SOFT_FAILING']
if new_soft_fails:
self.issues['new']['product'].append(IssueEntry(self.args, self.root_url, new_soft_fails))
if existing_soft_fails:
self.issues['existing']['product'].append(IssueEntry(self.args, self.root_url, existing_soft_fails))
评论列表
文章目录