2 # run tests on all Samba subprojects and push to a git tree on success
3 # Copyright Andrew Tridgell 2010
4 # released under GNU GPL v3 or later
6 from subprocess
import call
, check_call
,Popen
, PIPE
7 import os
, tarfile
, sys
, time
8 from optparse
import OptionParser
10 from email
.mime
.text
import MIMEText
11 from distutils
.sysconfig
import get_python_lib
13 # This speeds up testing remarkably.
14 os
.environ
['TDB_NO_FSYNC'] = '1'
20 "samba3-ctdb" : "source3",
27 "talloc" : "lib/talloc",
28 "replace" : "lib/replace",
29 "tevent" : "lib/tevent",
36 defaulttasks
= [ "samba3", "samba3-ctdb", "samba", "samba-ctdb", "samba-libs", "ldb", "tdb", "ntdb", "talloc", "replace", "tevent", "pidl" ]
39 "samba3" : [ ("autogen", "./autogen.sh", "text/plain"),
40 ("configure", "./configure.developer ${PREFIX}", "text/plain"),
41 ("make basics", "make basics", "text/plain"),
42 # we split 'make -j 4', 'make bin/smbtorture' and 'make -j 4 everything'
43 # because it makes it much easier to find errors.
44 ("make", "make -j 4", "text/plain"), # don't use too many processes
45 ("make bin/smbtorture", "make bin/smbtorture", "text/plain"),
46 ("make everything", "make -j 4 everything", "text/plain"),
47 ("install", "make install", "text/plain"),
48 ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"),
49 ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
50 ("clean", "make clean", "text/plain") ],
52 "samba3-ctdb" : [ ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
53 ("autogen", "./autogen.sh", "text/plain"),
54 ("configure", "./configure.developer ${PREFIX} --with-cluster-support --with-ctdb=../ctdb", "text/plain"),
55 ("make basics", "make basics", "text/plain"),
56 ("make", "make all", "text/plain"), # don't use too many processes
57 ("check", "LD_LIBRARY_PATH=./bin ./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
58 ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
59 ("clean", "make clean", "text/plain") ],
61 # We have 'test' before 'install' because, 'test' should work without 'install'
62 "samba" : [ ("configure", "./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab", "text/plain"),
63 ("make", "make -j", "text/plain"),
64 ("test", "make test FAIL_IMMEDIATELY=1", "text/plain"),
65 ("install", "make install", "text/plain"),
66 ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
67 ("clean", "make clean", "text/plain") ],
69 "samba-ctdb" : [ ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
71 # make sure we have tdb around:
72 ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
73 ("tdb-make", "cd lib/tdb && make", "text/plain"),
74 ("tdb-install", "cd lib/tdb && make install", "text/plain"),
76 # install the ctdb headers under the prefix:
77 ("ctdb-header-install", "cp ./ctdb/include/* ${PREFIX_DIR}/include", "text/plain"),
78 ("ctdb-header-ls", "ls ${PREFIX_DIR}/include/ctdb.h", "text/plain"),
80 ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure.developer ${PREFIX} ${PERL_VENDOR_LIB} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
81 ("make", "make", "text/plain"),
82 ("check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
83 ("install", "make install", "text/plain"),
84 ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
85 ("clean", "make clean", "text/plain") ],
88 ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
89 ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
90 ("talloc-make", "cd lib/talloc && make", "text/plain"),
91 ("talloc-install", "cd lib/talloc && make install", "text/plain"),
93 ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
94 ("tdb-make", "cd lib/tdb && make", "text/plain"),
95 ("tdb-install", "cd lib/tdb && make install", "text/plain"),
97 ("tevent-configure", "cd lib/tevent && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
98 ("tevent-make", "cd lib/tevent && make", "text/plain"),
99 ("tevent-install", "cd lib/tevent && make install", "text/plain"),
101 ("ldb-configure", "cd lib/ldb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
102 ("ldb-make", "cd lib/ldb && make", "text/plain"),
103 ("ldb-install", "cd lib/ldb && make install", "text/plain"),
105 ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX} ${PERL_VENDOR_LIB}", "text/plain"),
106 ("make", "make", "text/plain"),
107 ("install", "make install", "text/plain")],
110 ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
111 ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
112 ("make", "make", "text/plain"),
113 ("install", "make install", "text/plain"),
114 ("test", "make test", "text/plain"),
115 ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
116 ("distcheck", "make distcheck", "text/plain"),
117 ("clean", "make clean", "text/plain") ],
120 ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
121 ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
122 ("make", "make", "text/plain"),
123 ("install", "make install", "text/plain"),
124 ("test", "make test", "text/plain"),
125 ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
126 ("distcheck", "make distcheck", "text/plain"),
127 ("clean", "make clean", "text/plain") ],
130 ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
131 ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
132 ("make", "make", "text/plain"),
133 ("install", "make install", "text/plain"),
134 ("test", "make test", "text/plain"),
135 ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
136 ("distcheck", "make distcheck", "text/plain"),
137 ("clean", "make clean", "text/plain") ],
140 ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
141 ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
142 ("make", "make", "text/plain"),
143 ("install", "make install", "text/plain"),
144 ("test", "make test", "text/plain"),
145 ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
146 ("distcheck", "make distcheck", "text/plain"),
147 ("clean", "make clean", "text/plain") ],
150 ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
151 ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
152 ("make", "make", "text/plain"),
153 ("install", "make install", "text/plain"),
154 ("test", "make test", "text/plain"),
155 ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
156 ("distcheck", "make distcheck", "text/plain"),
157 ("clean", "make clean", "text/plain") ],
160 ("random-sleep", "../../script/random-sleep.sh 60 600", "text/plain"),
161 ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
162 ("make", "make", "text/plain"),
163 ("install", "make install", "text/plain"),
164 ("test", "make test", "text/plain"),
165 ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
166 ("distcheck", "make distcheck", "text/plain"),
167 ("clean", "make clean", "text/plain") ],
170 ("random-sleep", "../script/random-sleep.sh 60 600", "text/plain"),
171 ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"),
172 ("touch", "touch *.yp", "text/plain"),
173 ("make", "make", "text/plain"),
174 ("test", "make test", "text/plain"),
175 ("install", "make install", "text/plain"),
176 ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
177 ("clean", "make clean", "text/plain") ],
179 # these are useful for debugging autobuild
180 'pass' : [ ("pass", 'echo passing && /bin/true', "text/plain") ],
181 'fail' : [ ("fail", 'echo failing && /bin/false', "text/plain") ]
184 def run_cmd(cmd
, dir=".", show
=None, output
=False, checkfail
=True):
186 show
= options
.verbose
188 print("Running: '%s' in '%s'" % (cmd
, dir))
190 return Popen([cmd
], shell
=True, stdout
=PIPE
, cwd
=dir).communicate()[0]
192 return check_call(cmd
, shell
=True, cwd
=dir)
194 return call(cmd
, shell
=True, cwd
=dir)
197 class builder(object):
198 '''handle build of one directory'''
200 def __init__(self
, name
, sequence
):
202 self
.dir = builddirs
[name
]
204 self
.tag
= self
.name
.replace('/', '_')
205 self
.sequence
= sequence
207 self
.stdout_path
= "%s/%s.stdout" % (gitroot
, self
.tag
)
208 self
.stderr_path
= "%s/%s.stderr" % (gitroot
, self
.tag
)
210 print("stdout for %s in %s" % (self
.name
, self
.stdout_path
))
211 print("stderr for %s in %s" % (self
.name
, self
.stderr_path
))
212 run_cmd("rm -f %s %s" % (self
.stdout_path
, self
.stderr_path
))
213 self
.stdout
= open(self
.stdout_path
, 'w')
214 self
.stderr
= open(self
.stderr_path
, 'w')
215 self
.stdin
= open("/dev/null", 'r')
216 self
.sdir
= "%s/%s" % (testbase
, self
.tag
)
217 self
.prefix
= "%s/prefix/%s" % (testbase
, self
.tag
)
218 run_cmd("rm -rf %s" % self
.sdir
)
219 cleanup_list
.append(self
.sdir
)
220 cleanup_list
.append(self
.prefix
)
221 os
.makedirs(self
.sdir
)
222 run_cmd("rm -rf %s" % self
.sdir
)
223 run_cmd("git clone --shared %s %s" % (test_master
, self
.sdir
), dir=test_master
, show
=True)
226 def start_next(self
):
227 if self
.next
== len(self
.sequence
):
228 print '%s: Completed OK' % self
.name
231 (self
.stage
, self
.cmd
, self
.output_mime_type
) = self
.sequence
[self
.next
]
232 self
.cmd
= self
.cmd
.replace("${PYTHON_PREFIX}", get_python_lib(standard_lib
=1, prefix
=self
.prefix
))
233 self
.cmd
= self
.cmd
.replace("${PREFIX}", "--prefix=%s" % self
.prefix
)
234 self
.cmd
= self
.cmd
.replace("${PREFIX_DIR}", "%s" % self
.prefix
)
235 perl_vendor_lib
= "--with-perl-arch-install-dir=%s/share/perl5 " % self
.prefix
236 perl_vendor_lib
+= "--with-perl-lib-install-dir=%s/lib/perl5" % self
.prefix
237 self
.cmd
= self
.cmd
.replace("${PERL_VENDOR_LIB}", perl_vendor_lib
)
238 # if self.output_mime_type == "text/x-subunit":
239 # self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
240 print '%s: [%s] Running %s' % (self
.name
, self
.stage
, self
.cmd
)
242 os
.chdir("%s/%s" % (self
.sdir
, self
.dir))
243 self
.proc
= Popen(self
.cmd
, shell
=True,
244 stdout
=self
.stdout
, stderr
=self
.stderr
, stdin
=self
.stdin
)
249 class buildlist(object):
250 '''handle build of multiple directories'''
252 def __init__(self
, tasklist
, tasknames
, rebase_url
, rebase_branch
="master"):
255 self
.tail_proc
= None
258 tasknames
= defaulttasks
260 b
= builder(n
, tasks
[n
])
263 rebase_remote
= "rebaseon"
264 retry_task
= [ ("retry",
266 git remote add -t %s %s %s
270 git describe %s/%s > old_remote_branch.desc
272 git describe %s/%s > remote_branch.desc
273 diff old_remote_branch.desc remote_branch.desc
276 rebase_branch
, rebase_remote
, rebase_url
,
278 rebase_remote
, rebase_branch
,
280 rebase_remote
, rebase_branch
284 self
.retry
= builder('retry', retry_task
)
285 self
.need_retry
= False
288 if self
.tail_proc
is not None:
289 self
.tail_proc
.terminate()
290 self
.tail_proc
.wait()
291 self
.tail_proc
= None
292 if self
.retry
is not None:
293 self
.retry
.proc
.terminate()
294 self
.retry
.proc
.wait()
297 if b
.proc
is not None:
298 run_cmd("killbysubdir %s > /dev/null 2>&1" % b
.sdir
, checkfail
=False)
310 b
.status
= b
.proc
.poll()
316 ret
= self
.retry
.proc
.poll()
318 self
.need_retry
= True
328 if options
.retry
and self
.need_retry
:
330 print("retry needed")
331 return (0, None, None, None, "retry")
334 if os
.WIFSIGNALED(b
.status
) or os
.WEXITSTATUS(b
.status
) != 0:
336 return (b
.status
, b
.name
, b
.stage
, b
.tag
, "%s: [%s] failed '%s' with status %d" % (b
.name
, b
.stage
, b
.cmd
, b
.status
))
339 return (0, None, None, None, "All OK")
341 def tarlogs(self
, fname
):
342 tar
= tarfile
.open(fname
, "w:gz")
344 tar
.add(b
.stdout_path
, arcname
="%s.stdout" % b
.tag
)
345 tar
.add(b
.stderr_path
, arcname
="%s.stderr" % b
.tag
)
346 if os
.path
.exists("autobuild.log"):
347 tar
.add("autobuild.log")
350 def remove_logs(self
):
352 os
.unlink(b
.stdout_path
)
353 os
.unlink(b
.stderr_path
)
355 def start_tail(self
):
357 cmd
= "tail -f *.stdout *.stderr"
359 self
.tail_proc
= Popen(cmd
, shell
=True)
364 if options
.nocleanup
:
366 print("Cleaning up ....")
367 for d
in cleanup_list
:
368 run_cmd("rm -rf %s" % d
)
372 '''get to the top of the git repo'''
375 if os
.path
.isdir(os
.path
.join(p
, ".git")):
377 p
= os
.path
.abspath(os
.path
.join(p
, '..'))
381 def daemonize(logfile
):
383 if pid
== 0: # Parent
386 if pid
!= 0: # Actual daemon
391 import resource
# Resource usage information.
392 maxfd
= resource
.getrlimit(resource
.RLIMIT_NOFILE
)[1]
393 if maxfd
== resource
.RLIM_INFINITY
:
394 maxfd
= 1024 # Rough guess at maximum number of open file descriptors.
395 for fd
in range(0, maxfd
):
400 os
.open(logfile
, os
.O_RDWR | os
.O_CREAT
)
404 def write_pidfile(fname
):
405 '''write a pid file, cleanup on exit'''
406 f
= open(fname
, mode
='w')
407 f
.write("%u\n" % os
.getpid())
411 def rebase_tree(rebase_url
, rebase_branch
= "master"):
412 rebase_remote
= "rebaseon"
413 print("Rebasing on %s" % rebase_url
)
414 run_cmd("git describe HEAD", show
=True, dir=test_master
)
415 run_cmd("git remote add -t %s %s %s" %
416 (rebase_branch
, rebase_remote
, rebase_url
),
417 show
=True, dir=test_master
)
418 run_cmd("git fetch %s" % rebase_remote
, show
=True, dir=test_master
)
419 if options
.fix_whitespace
:
420 run_cmd("git rebase --force-rebase --whitespace=fix %s/%s" %
421 (rebase_remote
, rebase_branch
),
422 show
=True, dir=test_master
)
424 run_cmd("git rebase --force-rebase %s/%s" %
425 (rebase_remote
, rebase_branch
),
426 show
=True, dir=test_master
)
427 diff
= run_cmd("git --no-pager diff HEAD %s/%s" %
428 (rebase_remote
, rebase_branch
),
429 dir=test_master
, output
=True)
431 print("No differences between HEAD and %s/%s - exiting" %
432 (rebase_remote
, rebase_branch
))
434 run_cmd("git describe %s/%s" %
435 (rebase_remote
, rebase_branch
),
436 show
=True, dir=test_master
)
437 run_cmd("git describe HEAD", show
=True, dir=test_master
)
438 run_cmd("git --no-pager diff --stat HEAD %s/%s" %
439 (rebase_remote
, rebase_branch
),
440 show
=True, dir=test_master
)
442 def push_to(push_url
, push_branch
= "master"):
443 push_remote
= "pushto"
444 print("Pushing to %s" % push_url
)
446 run_cmd("git config --replace-all core.editor script/commit_mark.sh", dir=test_master
)
447 run_cmd("git commit --amend -c HEAD", dir=test_master
)
448 # the notes method doesn't work yet, as metze hasn't allowed refs/notes/* in master
449 # run_cmd("EDITOR=script/commit_mark.sh git notes edit HEAD", dir=test_master)
450 run_cmd("git remote add -t %s %s %s" %
451 (push_branch
, push_remote
, push_url
),
452 show
=True, dir=test_master
)
453 run_cmd("git push %s +HEAD:%s" %
454 (push_remote
, push_branch
),
455 show
=True, dir=test_master
)
457 def_testbase
= os
.getenv("AUTOBUILD_TESTBASE", "/memdisk/%s" % os
.getenv('USER'))
459 gitroot
= find_git_root()
461 raise Exception("Failed to find git root")
463 parser
= OptionParser()
464 parser
.add_option("", "--tail", help="show output while running", default
=False, action
="store_true")
465 parser
.add_option("", "--keeplogs", help="keep logs", default
=False, action
="store_true")
466 parser
.add_option("", "--nocleanup", help="don't remove test tree", default
=False, action
="store_true")
467 parser
.add_option("", "--testbase", help="base directory to run tests in (default %s)" % def_testbase
,
468 default
=def_testbase
)
469 parser
.add_option("", "--passcmd", help="command to run on success", default
=None)
470 parser
.add_option("", "--verbose", help="show all commands as they are run",
471 default
=False, action
="store_true")
472 parser
.add_option("", "--rebase", help="rebase on the given tree before testing",
473 default
=None, type='str')
474 parser
.add_option("", "--pushto", help="push to a git url on success",
475 default
=None, type='str')
476 parser
.add_option("", "--mark", help="add a Tested-By signoff before pushing",
477 default
=False, action
="store_true")
478 parser
.add_option("", "--fix-whitespace", help="fix whitespace on rebase",
479 default
=False, action
="store_true")
480 parser
.add_option("", "--retry", help="automatically retry if master changes",
481 default
=False, action
="store_true")
482 parser
.add_option("", "--email", help="send email to the given address on failure",
483 type='str', default
=None)
484 parser
.add_option("", "--always-email", help="always send email, even on success",
486 parser
.add_option("", "--daemon", help="daemonize after initial setup",
488 parser
.add_option("", "--branch", help="the branch to work on (default=master)",
489 default
="master", type='str')
490 parser
.add_option("", "--log-base", help="location where the logs can be found (default=cwd)",
491 default
=gitroot
, type='str')
493 def email_failure(status
, failed_task
, failed_stage
, failed_tag
, errstr
, log_base
=None):
494 '''send an email to options.email about the failure'''
495 user
= os
.getenv("USER")
501 Your autobuild failed when trying to test %s with the following error:
504 the autobuild has been abandoned. Please fix the error and resubmit.
506 A summary of the autobuild process is here:
509 ''' % (failed_task
, errstr
, log_base
)
511 if failed_task
!= 'rebase':
513 You can see logs of the failed task here:
518 or you can get full logs of all tasks in this job here:
522 The top commit for the tree that was built was:
526 ''' % (log_base
, failed_tag
, log_base
, failed_tag
, log_base
, top_commit_msg
)
528 msg
['Subject'] = 'autobuild failure for task %s during %s' % (failed_task
, failed_stage
)
529 msg
['From'] = 'autobuild@samba.org'
530 msg
['To'] = options
.email
534 s
.sendmail(msg
['From'], [msg
['To']], msg
.as_string())
537 def email_success(log_base
=None):
538 '''send an email to options.email about a successful build'''
539 user
= os
.getenv("USER")
545 Your autobuild has succeeded.
552 you can get full logs of all tasks in this job here:
559 The top commit for the tree that was built was:
565 msg
['Subject'] = 'autobuild success'
566 msg
['From'] = 'autobuild@samba.org'
567 msg
['To'] = options
.email
571 s
.sendmail(msg
['From'], [msg
['To']], msg
.as_string())
575 (options
, args
) = parser
.parse_args()
578 if options
.rebase
is None:
579 raise Exception('You can only use --retry if you also rebase')
581 testbase
= "%s/b%u" % (options
.testbase
, os
.getpid())
582 test_master
= "%s/master" % testbase
584 # get the top commit message, for emails
585 top_commit_msg
= run_cmd("git log -1", dir=gitroot
, output
=True)
588 os
.makedirs(testbase
)
589 except Exception, reason
:
590 raise Exception("Unable to create %s : %s" % (testbase
, reason
))
591 cleanup_list
.append(testbase
)
594 logfile
= os
.path
.join(testbase
, "log")
595 print "Forking into the background, writing progress to %s" % logfile
598 write_pidfile(gitroot
+ "/autobuild.pid")
602 run_cmd("rm -rf %s" % test_master
)
603 cleanup_list
.append(test_master
)
604 run_cmd("git clone --shared %s %s" % (gitroot
, test_master
), show
=True, dir=gitroot
)
611 if options
.rebase
is not None:
612 rebase_tree(options
.rebase
, rebase_branch
=options
.branch
)
614 cleanup_list
.append(gitroot
+ "/autobuild.pid")
616 email_failure(-1, 'rebase', 'rebase', 'rebase',
617 'rebase on %s failed' % options
.branch
,
618 log_base
=options
.log_base
)
620 blist
= buildlist(tasks
, args
, options
.rebase
, rebase_branch
=options
.branch
)
623 (status
, failed_task
, failed_stage
, failed_tag
, errstr
) = blist
.run()
624 if status
!= 0 or errstr
!= "retry":
631 cleanup_list
.append(gitroot
+ "/autobuild.pid")
635 print("waiting for tail to flush")
640 if options
.passcmd
is not None:
641 print("Running passcmd: %s" % options
.passcmd
)
642 run_cmd(options
.passcmd
, dir=test_master
)
643 if options
.pushto
is not None:
644 push_to(options
.pushto
, push_branch
=options
.branch
)
646 blist
.tarlogs("logs.tar.gz")
647 print("Logs in logs.tar.gz")
648 if options
.always_email
:
649 email_success(log_base
=options
.log_base
)
655 # something failed, gather a tar of the logs
656 blist
.tarlogs("logs.tar.gz")
658 if options
.email
is not None:
659 email_failure(status
, failed_task
, failed_stage
, failed_tag
, errstr
, log_base
=options
.log_base
)
663 print("Logs in logs.tar.gz")