Skip to content

Commit

Permalink
Remove bugzilla from blocker search
Browse files Browse the repository at this point in the history
  • Loading branch information
thegreyd committed Aug 3, 2023
1 parent 26bbedb commit 4f58134
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
11 changes: 2 additions & 9 deletions elliottlib/cli/find_bugs_blocker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,8 @@ def find_bugs_blocker_cli(runtime: Runtime, include_status, exclude_status, outp
find_bugs_obj = FindBugsBlocker()
find_bugs_obj.include_status(include_status)
find_bugs_obj.exclude_status(exclude_status)
exit_code = 0
for b in [runtime.get_bug_tracker('jira'), runtime.get_bug_tracker('bugzilla')]:
try:
find_bugs_blocker(runtime, output, find_bugs_obj, b)
except Exception as e:
runtime.logger.error(traceback.format_exc())
runtime.logger.error(f'exception with {b.type} bug tracker: {e}')
exit_code = 1
sys.exit(exit_code)

find_bugs_blocker(runtime, output, find_bugs_obj, runtime.get_bug_tracker('jira'))


def find_bugs_blocker(runtime, output, find_bugs_obj, bug_tracker):
Expand Down
9 changes: 0 additions & 9 deletions tests/test_find_bugs_blocker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,21 @@ def test_find_bugs_blocker(self):
flexmock(JIRABugTracker).should_receive("get_config").and_return({'target_release': ['4.6.z']})
flexmock(JIRABugTracker).should_receive("login").and_return(None)

bz_bug = flexmock(
id=1, created_days_ago=lambda: 33,
cf_pm_score='score', component='OLM',
status='ON_DEV', summary='summary'
)

jira_bug = flexmock(
id='OCPBUGS-1', created_days_ago=lambda: 34,
cf_pm_score='score', component='OLM',
status='ON_QA', summary='summary'
)

flexmock(JIRABugTracker).should_receive("blocker_search").and_return([jira_bug])
flexmock(BugzillaBugTracker).should_receive("blocker_search").and_return([bz_bug])
result = runner.invoke(cli, ['-g', 'openshift-4.6', 'find-bugs:blocker'])

bz_output = '1 OLM ON_DEV score 33 days summary'
jira_output = 'OCPBUGS-1 OLM ON_QA score 34 days summary'
if result.exit_code != 0:
exc_type, exc_value, exc_traceback = result.exc_info
t = "\n".join(traceback.format_exception(exc_type, exc_value, exc_traceback))
self.fail(t)
self.assertEqual(result.exit_code, 0)
self.assertIn(bz_output, result.output)
self.assertIn(jira_output, result.output)


Expand Down

0 comments on commit 4f58134

Please sign in to comment.