1
0
Fork 0

making feedback upload more relaxed if files are missing

This commit is contained in:
Christian Kühnel 2019-11-18 16:00:14 +01:00
parent 8522af95b4
commit c96a2d158c

View file

@ -93,10 +93,7 @@ class PhabTalk:
if test_case['result'] == 'fail': if test_case['result'] == 'fail':
header += ' failed: {}/{}\n'.format(test_case['namespace'], test_case['name']) header += ' failed: {}/{}\n'.format(test_case['namespace'], test_case['name'])
text = '' text = ''
if text_file_path is not None: if text_file_path is not None and os.path.exists(text_file_path):
if not os.path.exists(text_file_path):
raise FileNotFoundError('Could not find file with comments: {}'.format(text_file_path))
with open(text_file_path) as input_file: with open(text_file_path) as input_file:
text = input_file.read() text = input_file.read()
self._comment_on_diff(diff, header + text) self._comment_on_diff(diff, header + text)
@ -126,8 +123,8 @@ class PhabTalk:
result.result_type = 'pass' result.result_type = 'pass'
return result return result
if not os.path.exists(build_result_file): if not os.path.exists(build_result_file):
print('Could not find build results, assuming build failed: {}'.format(build_result_file)) print('Warning: Could not find test results file: {}'.format(build_result_file))
result.result_type = 'fail' result.result_type = 'pass'
return result return result
root_node = etree.parse(build_result_file) root_node = etree.parse(build_result_file)