summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2016-07-27 14:28:04 +1200
committerDouglas Bagnall <dbagnall@samba.org>2016-08-31 07:09:26 +0200
commitdb85692e4cd41499b5c4ec3220ae36da77afa2ef (patch)
treee70b1e8ee109ceb5d5e377602adf1ad14f61f6e1 /script
parent25efdf330bf91e7995c4d53a25713f2eaa364c0b (diff)
downloadsamba-db85692e4cd41499b5c4ec3220ae36da77afa2ef.tar.gz
autobuild --restrict-tests to test a restricted set
This allows autobuild to be used as a test framework for running particular Samba tests in a cloud environment. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'script')
-rwxr-xr-xscript/autobuild.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/script/autobuild.py b/script/autobuild.py
index b0695d04d2c..d6546052838 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -28,6 +28,7 @@ builddirs = {
"samba-ctdb" : ".",
"samba-libs" : ".",
"samba-static" : ".",
+ "samba-test-only" : ".",
"ldb" : "lib/ldb",
"tdb" : "lib/tdb",
"talloc" : "lib/talloc",
@@ -75,6 +76,10 @@ tasks = {
("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
("clean", "make clean", "text/plain") ],
+ "samba-test-only" : [ ("configure", "./configure.developer --with-selftest-prefix=./bin/ab --abi-check-disable" + samba_configure_params, "text/plain"),
+ ("make", "make -j", "text/plain"),
+ ("test", "make test FAIL_IMMEDIATELY=1 TESTS=${TESTS}", "text/plain") ],
+
# Test cross-compile infrastructure
"samba-xc" : [ ("configure-native", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
("configure-cross-execute", "./configure.developer -b ./bin-xe --cross-compile --cross-execute=script/identity_cc.sh" \
@@ -278,6 +283,7 @@ class builder(object):
self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
self.cmd = self.cmd.replace("${EXTRA_PYTHON}", "%s" % extra_python)
self.cmd = self.cmd.replace("${PREFIX_DIR}", "%s" % self.prefix)
+ self.cmd = self.cmd.replace("${TESTS}", options.restrict_tests)
# if self.output_mime_type == "text/x-subunit":
# self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
@@ -298,7 +304,10 @@ class buildlist(object):
self.tail_proc = None
self.retry = None
if tasknames == []:
- tasknames = defaulttasks
+ if options.restrict_tests:
+ tasknames = ["samba-test-only"]
+ else:
+ tasknames = defaulttasks
else:
# If we are only running one test,
# do not sleep randomly to wait for it to start
@@ -555,6 +564,8 @@ parser.add_option("", "--log-base", help="location where the logs can be found (
default=gitroot, type='str')
parser.add_option("", "--attach-logs", help="Attach logs to mails sent on success/failure?",
default=False, action="store_true")
+parser.add_option("", "--restrict-tests", help="run as make test with this TESTS= regex",
+ default='')
def send_email(subject, text, log_tar):
outer = MIMEMultipart()
@@ -599,6 +610,10 @@ A summary of the autobuild process is here:
%s/autobuild.log
''' % (platform.node(), elapsed_minutes, failed_task, errstr, log_base)
+ if options.restrict_tests:
+ text += """
+The build was restricted to tests matching %s\n""" % options.restrict_tests
+
if failed_task != 'rebase':
text += '''
You can see logs of the failed task here:
@@ -650,6 +665,10 @@ Your autobuild on %s has succeeded after %.1f minutes.
''' % (platform.node(), elapsed_time / 60.)
+ if options.restrict_tests:
+ text += """
+The build was restricted to tests matching %s\n""" % options.restrict_tests
+
if options.keeplogs:
text += '''