Improving email report

This commit is contained in:
Sergio Durigan Junior 2015-02-04 23:29:25 -05:00
parent bf89955efc
commit d8f6a87dc7

View file

@ -179,13 +179,14 @@ send to the gdb-testers mailing list."""
# Including the 'regressions' log. This is the 'diff' of what # Including the 'regressions' log. This is the 'diff' of what
# went wrong. # went wrong.
text += "\n" text += "\n"
print_xfail = False found_regressions = False
for log in build.getLogs (): for log in build.getLogs ():
st = log.getStep () st = log.getStep ()
if st.getResults ()[0] == FAILURE: if st.getResults ()[0] == FAILURE:
n = st.getName () n = st.getName ()
if n == 'update gdb master repo': if n == 'update gdb master repo':
text += "*** Failed to update master GDB git repository. The build can continue. ***\n\n" text += "*** Failed to update master GDB git repository. The build can continue. ***\n\n"
continue
elif n == 'update gdb repo': elif n == 'update gdb repo':
text += "*** Failed to update GDB git repository. This is probably a timeout problem. ***\n\n" text += "*** Failed to update GDB git repository. This is probably a timeout problem. ***\n\n"
break break
@ -213,18 +214,27 @@ send to the gdb-testers mailing list."""
text += "============================\n" text += "============================\n"
text += log.getText () text += log.getText ()
text += "============================\n" text += "============================\n"
print_xfail = True found_regressions = True
break break
# Including the 'xfail' log. It is important to say which tests # Including the 'xfail' log. It is important to say which tests
# we are ignoring. # we are ignoring.
if print_xfail: if found_regressions:
for log in build.getLogs ():
if log.getStep ().getName () == 'regressions' and log.getName () == 'baseline_diff':
text += "\n\n*** Also, the following failures have been found when comparing to the baseline ***\n"
text += "============================\n"
text += log.getText ()
text += "============================\n"
break
xfail = os.path.join (gdb_web_base, name, 'xfails', branch, 'xfail') xfail = os.path.join (gdb_web_base, name, 'xfails', branch, 'xfail')
if os.path.exists (xfail): if os.path.exists (xfail):
text += "\n" text += "\n\n***Failures that are being ignored:\n"
text += "Failures that are being ignored:\n\n" text += "============================\n"
with open (xfail, 'r') as f: with open (xfail, 'r') as f:
text += f.read () text += f.read ()
text += "============================\n"
text += "\n" text += "\n"
return { 'body' : text, return { 'body' : text,
'type' : 'plain', 'type' : 'plain',