[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Jun 10 05:27:04 MDT 2015


The branch, master has been updated
       via  81f0592 autobuild email mentions the elapsed time
      from  d0f7651 pytevent: Build for two versions of Python at once

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 81f05927b8f521fd6e14d5b9f9a1b60c965f2604
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu May 28 13:46:23 2015 +1200

    autobuild email mentions the elapsed time
    
    This is occasionally very useful. When it is not, it is easily ignored.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Jun 10 13:26:21 CEST 2015 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 script/autobuild.py | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/script/autobuild.py b/script/autobuild.py
index c697aad..d2662b9 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -514,15 +514,19 @@ def send_email(subject, text, log_tar):
     s.set_debuglevel(1)
     s.quit()
 
-def email_failure(status, failed_task, failed_stage, failed_tag, errstr, log_base=None):
+def email_failure(status, failed_task, failed_stage, failed_tag, errstr,
+                  elapsed_time, log_base=None):
     '''send an email to options.email about the failure'''
+    elapsed_minutes = elapsed_time / 60.0
     user = os.getenv("USER")
     if log_base is None:
         log_base = gitroot
     text = '''
 Dear Developer,
 
-Your autobuild on %s failed when trying to test %s with the following error:
+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.
@@ -530,7 +534,7 @@ the autobuild has been abandoned. Please fix the error and resubmit.
 A summary of the autobuild process is here:
 
   %s/autobuild.log
-''' % (platform.node(), failed_task, errstr, log_base)
+''' % (platform.node(), elapsed_minutes, failed_task, errstr, log_base)
 
     if failed_task != 'rebase':
         text += '''
@@ -554,7 +558,7 @@ The top commit for the tree that was built was:
                % (platform.node(), failed_task, failed_stage),
                text, logs)
 
-def email_success(log_base=None):
+def email_success(elapsed_time, log_base=None):
     '''send an email to options.email about a successful build'''
     user = os.getenv("USER")
     if log_base is None:
@@ -562,9 +566,9 @@ def email_success(log_base=None):
     text = '''
 Dear Developer,
 
-Your autobuild on %s has succeeded.
+Your autobuild on %s has succeeded after %.1f minutes.
 
-''' % platform.node()
+''' % (platform.node(), elapsed_time / 60.)
 
     if options.keeplogs:
         text += '''
@@ -611,6 +615,8 @@ if options.daemon:
 
 write_pidfile(gitroot + "/autobuild.pid")
 
+start_time = time.time()
+
 while True:
     try:
         run_cmd("rm -rf %s" % test_master)
@@ -627,9 +633,10 @@ while True:
         except Exception:
             cleanup_list.append(gitroot + "/autobuild.pid")
             cleanup()
+            elapsed_time = time.time() - start_time
             email_failure(-1, 'rebase', 'rebase', 'rebase',
                           'rebase on %s failed' % options.branch,
-                          log_base=options.log_base)
+                          elapsed_time, log_base=options.log_base)
             sys.exit(1)
         blist = buildlist(tasks, args, options.rebase, rebase_branch=options.branch)
         if options.tail:
@@ -649,6 +656,7 @@ if options.tail:
     print("waiting for tail to flush")
     time.sleep(1)
 
+elapsed_time = time.time() - start_time
 if status == 0:
     print errstr
     if options.passcmd is not None:
@@ -660,7 +668,7 @@ if status == 0:
         blist.tarlogs("logs.tar.gz")
         print("Logs in logs.tar.gz")
     if options.always_email:
-        email_success(log_base=options.log_base)
+        email_success(elapsed_time, log_base=options.log_base)
     blist.remove_logs()
     cleanup()
     print(errstr)
@@ -670,7 +678,8 @@ if status == 0:
 blist.tarlogs("logs.tar.gz")
 
 if options.email is not None:
-    email_failure(status, failed_task, failed_stage, failed_tag, errstr, log_base=options.log_base)
+    email_failure(status, failed_task, failed_stage, failed_tag, errstr,
+                  elapsed_time, log_base=options.log_base)
 
 cleanup()
 print(errstr)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list