autobuild: Give a clearer failure message
authorAndrew Bartlett <abartlet@samba.org>
Wed, 21 Oct 2015 01:35:33 +0000 (14:35 +1300)
committerStefan Metzmacher <metze@samba.org>
Tue, 5 Jan 2016 08:10:24 +0000 (09:10 +0100)
This helps when autobuild.py is used in --tail mode and
where there is neither e-mail nor access to the logs.tar.gz

Working back to find where the error happened is typically
quite difficult, as many failures are actually due to the
cleanup.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
script/autobuild.py

index 2d3af2a7db28e1e72bc6057769ae100bfd8d33ce..8d1060e9115fb808d22ddb543f8ebd1ddbd109b0 100755 (executable)
@@ -720,6 +720,24 @@ blist.tarlogs("logs.tar.gz")
 if options.email is not None:
     email_failure(status, failed_task, failed_stage, failed_tag, errstr,
                   elapsed_time, log_base=options.log_base)
+else:
+    elapsed_minutes = elapsed_time / 60.0
+    print '''
+
+####################################################################
+
+AUTOBUILD FAILURE
+
+Your autobuild on %s failed after %.1f minutes
+when trying to test %s with the following error:
+
+   %s
+
+the autobuild has been abandoned. Please fix the error and resubmit.
+
+####################################################################
+
+''' % (platform.node(), elapsed_minutes, failed_task, errstr)
 
 cleanup()
 print(errstr)