[SCM] build.samba.org - branch master updated
Matthieu Patou
mat at samba.org
Sat Nov 6 05:15:56 MDT 2010
The branch, master has been updated
via 0732b86 Add tests for build_status_from_logs
via da03099 Be constant: return always integer if value
from 6505499 Inline test data.
http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0732b861752b26d21bb2743526e349eae30f82a7
Author: Matthieu Patou <mat at matws.net>
Date: Sat Nov 6 14:16:26 2010 +0300
Add tests for build_status_from_logs
commit da03099513b77b0631d72af298382119d5937ac4
Author: Matthieu Patou <mat at matws.net>
Date: Sat Nov 6 14:13:10 2010 +0300
Be constant: return always integer if value
-----------------------------------------------------------------------
Summary of changes:
buildfarm/data.py | 20 ++++++++++----------
buildfarm/tests/test_data.py | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 10 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildfarm/data.py b/buildfarm/data.py
index 8a2ce6c..0e1e94f 100644
--- a/buildfarm/data.py
+++ b/buildfarm/data.py
@@ -36,9 +36,9 @@ def check_dir_exists(kind, path):
def build_status_from_logs(log, err):
"""get status of build"""
- m = re.search("TEST STATUS:(.*)", log)
+ m = re.search("TEST STATUS:(\s*\d+)", log)
if m:
- tstatus = m.group(1)
+ tstatus = int(m.group(1).strip())
else:
m = re.search("ACTION (PASSED|FAILED): test", log)
if m:
@@ -51,21 +51,21 @@ def build_status_from_logs(log, err):
else:
tstatus = None
- m = re.search("INSTALL STATUS:(.*)", log)
+ m = re.search("INSTALL STATUS:(\s*\d+)", log)
if m:
- istatus = m.group(1)
+ istatus = int(m.group(1).strip())
else:
istatus = None
- m = re.search("BUILD STATUS:(.*)", log)
+ m = re.search("BUILD STATUS:(\s*\d+)", log)
if m:
- bstatus = m.group(1)
+ bstatus = int(m.group(1).strip())
else:
bstatus = None
- m = re.search("CONFIGURE STATUS:(.*)", log)
+ m = re.search("CONFIGURE STATUS:(\s*\d+)", log)
if m:
- cstatus = m.group(1)
+ cstatus = int(m.group(1).strip())
else:
cstatus = None
@@ -80,9 +80,9 @@ def build_status_from_logs(log, err):
if "maximum runtime exceeded" in log:
other_failures.add("timeout")
- m = re.search("CC_CHECKER STATUS: (.*)", log)
+ m = re.search("CC_CHECKER STATUS:(\s*\d+)", log)
if m:
- sstatus = m.group(1)
+ sstatus = int(m.group(1).strip())
else:
sstatus = None
diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py
index 2ce5198..6ef0a18 100755
--- a/buildfarm/tests/test_data.py
+++ b/buildfarm/tests/test_data.py
@@ -32,6 +32,47 @@ class NonexistantTests(unittest.TestCase):
self.assertRaises(
Exception, data.BuildResultStore, "somedirthatdoesn'texist", None)
+class BuildStatusFromLogs(testtools.TestCase):
+
+
+ def test_build_status_from_logs(self):
+ log = """
+TEST STATUS:1
+"""
+ res = data.build_status_from_logs(log, "")
+ self.assertEquals(res[0][3], 1)
+ log = """
+TEST STATUS: 1
+"""
+ res = data.build_status_from_logs(log, "")
+ self.assertEquals(res[0][3], 1)
+ log = """
+CONFIGURE STATUS: 2
+TEST STATUS: 1
+CC_CHECKER STATUS: 2
+"""
+ res = data.build_status_from_logs(log, "")
+ self.assertEquals(res[0][4], 2)
+ log = """
+CONFIGURE STATUS: 2
+ACTION PASSED: test
+CC_CHECKER STATUS: 2
+"""
+ res = data.build_status_from_logs(log, "")
+ self.assertEquals(res[0][4], 2)
+ self.assertEquals(res[0][3], 255)
+ log = """
+CONFIGURE STATUS: 2
+ACTION PASSED: test
+testsuite-success: toto
+testsuite-failure: foo
+testsuite-failure: bar
+testsuite-failure: biz
+CC_CHECKER STATUS: 2
+"""
+ res = data.build_status_from_logs(log, "")
+ self.assertEquals(res[0][0], 2)
+ self.assertEquals(res[0][3], 3)
class ReadTreesFromConfTests(testtools.TestCase):
--
build.samba.org
More information about the samba-cvs
mailing list