[SCM] build.samba.org - branch master updated
The branch, master has been updated via d81c9cd Remove more pointless encoding. from 6bfd1e4 Get rid of some unicode. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit d81c9cd5e8fc9ebfb7c42508c8f46fd8b6910132 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 11:19:32 2010 +0100 Remove more pointless encoding. --- Summary of changes: buildfarm/hostdb.py |4 ++-- buildfarm/web/__init__.py | 12 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/hostdb.py b/buildfarm/hostdb.py index ed4e753..24186c2 100644 --- a/buildfarm/hostdb.py +++ b/buildfarm/hostdb.py @@ -125,7 +125,7 @@ class HostDatabase(object): Write out the web/ for host in self.hosts(): -yield %s: %s\n % (host.name.encode(utf-8), host.platform.encode(utf-8)) +yield %s: %s\n % (host.name, host.platform.encode(utf-8)) def commit(self): pass @@ -143,7 +143,7 @@ class PlainTextHostDatabase(HostDatabase): try: for l in f: (host, platform) = l.split(:, 1) -ret[host.decode(utf-8)] = platform.strip().decode(utf-8) +ret[host] = platform.strip().decode(utf-8) finally: f.close() return cls(ret) diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 159085f..7badf2d 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -628,9 +628,9 @@ class ViewRecentBuildsPage(BuildFarmPage): build.age, host.platform.encode(utf-8), a href='%s?function=View+Host;host=%s;tree=%s;compiler=%s#%s'%s/a -% (myself, host.name.encode(utf-8), - tree, build.compiler.encode(utf-8), host.name.encode(utf-8), - host.name.encode(utf-8)), +% (myself, host.name, + tree, build.compiler, host.name, + host.name), build.compiler, tree, status, build.status(), revision_link(myself, revision, tree), revision_time]) @@ -674,7 +674,7 @@ class ViewHostPage(BuildFarmPage): def _render_build_list_header(self, host): yield div class='host summary' yield a id='host' name='host'/ -yield h3%s - %s/h3 % (host.encode(utf-8), self.buildfarm.hostdb.host(host).platform.encode(utf-8)) +yield h3%s - %s/h3 % (host, self.buildfarm.hostdb.host(host).platform.encode(utf-8)) yield table class='real' yield theadtrthTarget/ththBuildbr/Revision/ththBuildbr /Age/ththStatusbr /config/buildbr /install/test/ththWarnings/th/tr/thead yield tbody @@ -734,7 +734,7 @@ class ViewHostPage(BuildFarmPage): Tree, Compiler, Build Age, Status, Warnings) for build in builds: yield %-12s %-10s %-10s %-10s %-10s\n % ( -build.tree.encode(utf-8), build.compiler.encode(utf-8), +build.tree, build.compiler, util.dhm_time(build.age), str(build.status()), build.err_count()) yield \n @@ -895,7 +895,7 @@ class BuildFarmApp(object): self.buildfarm = buildfarm # host.properties are unicode object and the framework expect string object -self.hosts = dict([(host.name.encode(utf-8), host) for host in self.buildfarm.hostdb.hosts()]) +self.hosts = dict([(host.name, host) for host in self.buildfarm.hostdb.hosts()]) def main_menu(self): main page -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 7645665 Add test for Kai's wrong culprit mail. via 4b037f0 Simplify menu. from d81c9cd Remove more pointless encoding. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 76456654a64f6b058a2d14d93c6474a360661f7f Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 11:38:27 2010 +0100 Add test for Kai's wrong culprit mail. commit 4b037f0066cafaca84d7a62ee8438eeb21281f45 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 11:36:53 2010 +0100 Simplify menu. --- Summary of changes: buildfarm/tests/test_data.py |8 +++- buildfarm/web/__init__.py| 13 ++--- 2 files changed, 9 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 4ed8a16..cf4d906 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -18,7 +18,6 @@ from cStringIO import StringIO import os import testtools -import time import unittest from buildfarm import data @@ -340,6 +339,13 @@ class BuildStatusRegressedSinceTests(testtools.TestCase): ([(CONFIGURE, 0)], []), ([(CONFIGURE, 0), (BUILD, 0)], [])) +def test_less_errors(self): +self.assertRegressedSince( +False, +([(CONFIGURE, 0), (BUILD, 0), (TEST, 0), (INSTALL, 1)], []), +([(CONFIGURE, 0), (BUILD, 0), (TEST, 0), (INSTALL, 0)], [])) + + class UploadBuildResultStoreTestBase(object): diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 7badf2d..3d091a4 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -698,12 +698,6 @@ class ViewHostPage(BuildFarmPage): yield div class='build-section' id='build-summary' yield 'h2Host summary:/h2' for host in requested_hosts: -# make sure we have some data from it -try: -self.buildfarm.hostdb.host(host) -except hostdb.NoSuchHost: -continue - builds = list(self.buildfarm.get_host_builds(host)) if len(builds) 0: yield .join(self._render_build_list_header(host)) @@ -894,18 +888,15 @@ class BuildFarmApp(object): def __init__(self, buildfarm): self.buildfarm = buildfarm -# host.properties are unicode object and the framework expect string object -self.hosts = dict([(host.name, host) for host in self.buildfarm.hostdb.hosts()]) - def main_menu(self): main page yield form method='GET'\n yield div id='build-menu'\n yield select name='host'\n -for name, host in self.hosts.iteritems(): +for host in self.buildfarm.hostdb.hosts(): yield option value='%s'%s -- %s/option\n % ( -name, host.platform.encode(utf-8), name) +host.name, host.platform.encode(utf-8), host.name) yield /select\n yield select name='tree'\n for tree, t in self.buildfarm.trees.iteritems(): -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 088d389 Add id column to host. from 7645665 Add test for Kai's wrong culprit mail. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 088d3890082900cdbef6c22b62c74ee658793a4e Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 11:49:13 2010 +0100 Add id column to host. --- Summary of changes: .bzrignore |1 + buildfarm/sqldb.py |5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/.bzrignore b/.bzrignore index 222c794..a34bfd1 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,2 +1,3 @@ hostdb.sqlite _trial_temp +db diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index 11994c0..4542c8a 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -73,7 +73,8 @@ class StormBuild(Build): class StormHost(Host): __storm_table__ = host -name = RawStr(primary=True) +id = Int(primary=True) +name = RawStr() owner_name = Unicode(name=owner) owner_email = Unicode() password = Unicode() @@ -258,7 +259,7 @@ class StormCachingBuildFarm(BuildFarm): def setup_schema(db): -db.execute(CREATE TABLE IF NOT EXISTS host (name blob, owner text, owner_email text, password text, ssh_access int, fqdn text, platform text, permission text, last_dead_mail int, join_time int);, noresult=True) +db.execute(CREATE TABLE IF NOT EXISTS host (id integer primary key autoincrement, name blob, owner text, owner_email text, password text, ssh_access int, fqdn text, platform text, permission text, last_dead_mail int, join_time int);, noresult=True) db.execute(CREATE UNIQUE INDEX IF NOT EXISTS unique_hostname ON host (name);, noresult=True) db.execute(CREATE TABLE IF NOT EXISTS build (id integer primary key autoincrement, tree blob, revision blob, host blob, compiler blob, checksum blob, age int, status blob, commit_revision blob);, noresult=True) db.execute(CREATE UNIQUE INDEX IF NOT EXISTS unique_checksum ON build (checksum);, noresult=True) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 1f98541 Add CGI_DEBUG variable. from 0cb42c2 Add buildfarm.web tests. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 1f985416a874ef995e451af972947ff0cb24b989 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 16 22:48:10 2010 +0100 Add CGI_DEBUG variable. --- Summary of changes: buildfarm/web/__init__.py | 15 +++ web/build.cgi |6 ++ 2 files changed, 13 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index dda4b17..e0af291 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -467,19 +467,18 @@ class ViewBuildPage(BuildFarmPage): if len(old_rev_builds) == 0: return -yield h2Older builds:/h2 +yield h2Older builds:/h2\n -yield table class='real' -yield theadtrthRevision/ththStatus/th/tr/thead -yield tbody +yield table class='real'\n +yield theadtrthRevision/ththStatus/th/tr/thead\n +yield tbody\n for build in old_rev_builds: -yield trtd%s/tdtd%s/td/tr % ( +yield trtd%s/tdtd%s/td/tr\n % ( revision_link(myself, build.revision, tree), -build_link(myself, tree, host, compiler, build.revision, -html_build_status(build.status( +build_status_html(myself, build)) -yield /tbody/table +yield /tbody/table\n def render(self, myself, tree, host, compiler, rev, plain_logs=False): view one build in detail diff --git a/web/build.cgi b/web/build.cgi index 3f6b295..da748ca 100755 --- a/web/build.cgi +++ b/web/build.cgi @@ -32,4 +32,10 @@ resource.setrlimit(resource.RLIMIT_DATA, (30, 30)) buildfarm = CachingBuildFarm() buildApp = BuildFarmApp(buildfarm) handler = wsgiref.handlers.CGIHandler() +CGI_DEBUG = False + +if CGI_DEBUG: +import cgitb +cgitb.enable() +handler.log_exception = cgitb.handler handler.run(buildApp) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 77951af Fix access to buildfarm variable. from 1f98541 Add CGI_DEBUG variable. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 77951af92f278155ab01666b8f855fa5c59c66df Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 16 22:50:16 2010 +0100 Fix access to buildfarm variable. --- Summary of changes: buildfarm/web/__init__.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index e0af291..6bf88fe 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -809,7 +809,7 @@ class ViewSummaryPage(BuildFarmPage): for compiler in self.buildfarm.compilers: for tree in self.buildfarm.trees: try: -build = buildfarm.get_build(tree, host.name.encode(utf-8), compiler) +build = self.buildfarm.get_build(tree, host.name, compiler) status = build_status_html(myself, build) except data.NoSuchBuildError: continue -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 3ad205e switch over to sqlite database by default. from 77951af Fix access to buildfarm variable. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 3ad205e5236529904fa89f2c7a37d9869607c0c9 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 16 23:02:50 2010 +0100 switch over to sqlite database by default. --- Summary of changes: buildfarm/web/__init__.py |2 +- web/build.cgi |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 6bf88fe..f584a21 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -846,7 +846,7 @@ class ViewSummaryPage(BuildFarmPage): yield td yield %d/td % panic_count[tree] try: -lcov_status = buildfarm.lcov_status(tree) +lcov_status = self.buildfarm.lcov_status(tree) except data.NoSuchBuildError: yield td/td else: diff --git a/web/build.cgi b/web/build.cgi index da748ca..c8ad30b 100755 --- a/web/build.cgi +++ b/web/build.cgi @@ -21,7 +21,7 @@ import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), ..)) -from buildfarm.filecache import CachingBuildFarm +from buildfarm.sqldb import StormCachingBuildFarm from buildfarm.web import BuildFarmApp import wsgiref.handlers import resource @@ -29,7 +29,7 @@ import resource resource.setrlimit(resource.RLIMIT_RSS, (30, 30)) resource.setrlimit(resource.RLIMIT_DATA, (30, 30)) -buildfarm = CachingBuildFarm() +buildfarm = StormCachingBuildFarm() buildApp = BuildFarmApp(buildfarm) handler = wsgiref.handlers.CGIHandler() CGI_DEBUG = False -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via aa21359 Enable debugging as early as possible. from 3ad205e switch over to sqlite database by default. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit aa21359eafa883b2b6fe79a4d69b79308a8d8a66 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 16 23:11:45 2010 +0100 Enable debugging as early as possible. --- Summary of changes: web/build.cgi |9 + 1 files changed, 5 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/web/build.cgi b/web/build.cgi index c8ad30b..8b919ff 100755 --- a/web/build.cgi +++ b/web/build.cgi @@ -21,16 +21,12 @@ import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), ..)) -from buildfarm.sqldb import StormCachingBuildFarm -from buildfarm.web import BuildFarmApp import wsgiref.handlers import resource resource.setrlimit(resource.RLIMIT_RSS, (30, 30)) resource.setrlimit(resource.RLIMIT_DATA, (30, 30)) -buildfarm = StormCachingBuildFarm() -buildApp = BuildFarmApp(buildfarm) handler = wsgiref.handlers.CGIHandler() CGI_DEBUG = False @@ -38,4 +34,9 @@ if CGI_DEBUG: import cgitb cgitb.enable() handler.log_exception = cgitb.handler + +from buildfarm.sqldb import StormCachingBuildFarm +from buildfarm.web import BuildFarmApp +buildfarm = StormCachingBuildFarm() +buildApp = BuildFarmApp(buildfarm) handler.run(buildApp) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 2dac42b Set umask. from aa21359 Enable debugging as early as possible. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 2dac42ba046dc9c00982e07851fd547a4d0a61b1 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 16 23:17:18 2010 +0100 Set umask. --- Summary of changes: buildfarm/sqldb.py | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index e0ef491..95529ed 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -221,9 +221,13 @@ class StormCachingBuildFarm(BuildFarm): if self.store is not None: return self.store db_path = os.path.join(self.path, db, hostdb.sqlite) -db = create_database(sqlite:%s?timeout=%f % (db_path, self.timeout)) -self.store = Store(db) -setup_schema(self.store) +umask = os.umask(0664) +try: +db = create_database(sqlite:%s?timeout=%f % (db_path, self.timeout)) +self.store = Store(db) +setup_schema(self.store) +finally: +os.umask(umask) return self.store def _open_hostdb(self): -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 46fe0ca Fix use of buildfarm global variable. via 3843593 Split up pages a bit. from 2dac42b Set umask. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 46fe0ca2a4c582563f96aa1212b440fda2dd61c4 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 00:27:10 2010 +0100 Fix use of buildfarm global variable. commit 3843593b074e8c70f8c76cf723ebf14f7b34628a Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 00:15:45 2010 +0100 Split up pages a bit. --- Summary of changes: buildfarm/__init__.py | 11 +++ buildfarm/data.py |6 ++ buildfarm/sqldb.py| 15 +++- buildfarm/web/__init__.py | 219 ++--- 4 files changed, 137 insertions(+), 114 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 8d593c4..41df8d1 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -140,3 +140,14 @@ class BuildFarm(object): for build in self.upload_builds.get_new_builds(): if build.tree in self.trees and build.compiler in self.compilers and build.host in hostnames: yield build + +def get_host_builds(self, host): +from buildfarm import data +for compiler in self.compilers: +for tree in sorted(self.trees.keys()): +try: +yield self.get_build(tree, host, compiler) +except data.NoSuchBuildError: +pass + + diff --git a/buildfarm/data.py b/buildfarm/data.py index 36c3424..750deac 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -61,6 +61,12 @@ class BuildStatus(object): else: self.other_failures = set() +@property +def failed(self): +if self.other_failures: +return True +return not all([x == 0 for x in self._status_tuple()]) + def __serialize__(self): return repr(self) diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index 95529ed..f7eb9e7 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -108,7 +108,9 @@ class StormHostDatabase(HostDatabase): else: self.store = store -def createhost(self, name, platform=None, owner=None, owner_email=None, password=None, permission=None): +def createhost(self, name, platform=None, owner=None, owner_email=None, +password=None, permission=None): +See `HostDatabase.createhost`. newhost = StormHost(unicode(name), owner=owner, owner_email=owner_email, password=password, permission=permission, platform=platform) try: self.store.add(newhost) @@ -183,7 +185,9 @@ class StormCachingBuildResultStore(BuildResultStore): return build.revision def _get_by_checksum(self, build): -return self.store.find(StormBuild, StormBuild.checksum == build.log_checksum()).one() +result = self.store.find(StormBuild, +StormBuild.checksum == build.log_checksum()) +return result.one() def upload_build(self, build): existing_build = self._get_by_checksum(build) @@ -196,7 +200,8 @@ class StormCachingBuildResultStore(BuildResultStore): rev, timestamp = build.revision_details() super(StormCachingBuildResultStore, self).upload_build(build) new_basename = self.build_fname(build.tree, build.host, build.compiler, rev) -new_build = StormBuild(new_basename, unicode(build.tree), unicode(build.host), unicode(build.compiler), rev) +new_build = StormBuild(new_basename, unicode(build.tree), unicode(build.host), +unicode(build.compiler), rev) new_build.checksum = build.log_checksum() new_build.age = build.age_mtime() new_build.status_str = unicode(build.status().__serialize__()) @@ -237,6 +242,10 @@ class StormCachingBuildFarm(BuildFarm): return StormCachingBuildResultStore(os.path.join(self.path, data, oldrevs), self._get_store()) +def get_host_builds(self, host): +return self._get_store().find(StormBuild, +StormBuild.host == host).group_by(StormBuild.compiler, StormBuild.tree) + def commit(self): self.store.commit() diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index f584a21..ceb019a 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -490,7 +490,7 @@ class ViewBuildPage(BuildFarmPage): uname = cflags = config = -build = buildfarm.get_build(tree, host, compiler, rev) +build = self.buildfarm.get_build(tree, host, compiler, rev) age_mtime = build.age_mtime() try: (revision, revision_time) = build.revision_details
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 8f059d0 Fix host finding with older versions of storm. from 46fe0ca Fix use of buildfarm global variable. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 8f059d0818f0d339a7e2025266d5dfa7b14efe26 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 00:43:49 2010 +0100 Fix host finding with older versions of storm. --- Summary of changes: buildfarm/sqldb.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index f7eb9e7..cac733e 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -129,7 +129,7 @@ class StormHostDatabase(HostDatabase): return self.store.find(StormHost).order_by(StormHost.name) def host(self, name): -ret = self.hosts().find(StormHost.name==name).one() +ret = self.store.find(StormHost, StormHost.name==name).one() if ret is None: raise NoSuchHost(name) return ret -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 707823c Avoid unnecessary host lookup. from 8f059d0 Fix host finding with older versions of storm. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 707823cebcffadb8ad87df3643be70ab574c7b25 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 00:57:39 2010 +0100 Avoid unnecessary host lookup. --- Summary of changes: buildfarm/web/__init__.py |4 1 files changed, 0 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index ceb019a..2db0d05 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -482,10 +482,6 @@ class ViewBuildPage(BuildFarmPage): def render(self, myself, tree, host, compiler, rev, plain_logs=False): view one build in detail -# ensure the params are valid before using them -self.buildfarm.hostdb.host(host) -assert compiler in self.buildfarm.compilers, unknown compiler %s % compiler -assert tree in self.buildfarm.trees, not a build tree %s % tree uname = cflags = -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via a54c867 Store more as plain strings. from 707823c Avoid unnecessary host lookup. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit a54c867c7c2b85a4872c40427c240f5ba75905d6 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:11:37 2010 +0100 Store more as plain strings. --- Summary of changes: admin.py | 10 +- buildfarm/sqldb.py | 36 ++-- buildfarm/tests/test_hostdb.py | 28 ++-- buildfarm/web/__init__.py | 14 +++--- 4 files changed, 44 insertions(+), 44 deletions(-) Changeset truncated at 500 lines: diff --git a/admin.py b/admin.py index 79c6ce7..cc8edf9 100755 --- a/admin.py +++ b/admin.py @@ -70,7 +70,7 @@ else: if op == remove: hostname = raw_input(Please enter hostname to delete: ) try: -db.deletehost(hostname.decode(utf-8)) +db.deletehost(hostname) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) @@ -81,7 +81,7 @@ if op == remove: elif op == modify: hostname = raw_input(Please enter hostname to modify: ) try: -host = db.host(hostname.decode(utf-8)) +host = db.host(hostname) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) @@ -108,7 +108,7 @@ elif op == modify: elif op == add: hostname = raw_input(Machine hostname: ) try: -db.host(hostname.decode(utf-8)) +db.host(hostname) except hostdb.NoSuchHost, e: pass else: @@ -129,7 +129,7 @@ elif op == add: line = raw_input() try: -db.createhost(hostname.decode(utf-8), platform.decode(utf-8), +db.createhost(hostname, platform.decode(utf-8), owner.decode(utf-8), owner_email.decode(utf-8), password.decode(utf-8), .join(permission).decode(utf-8, replace)) @@ -192,7 +192,7 @@ Thanks, your friendly Samba build farm administrator bu...@samba.org % owne elif op == info: hostname = raw_input(Hostname: ) try: -host = db.host(hostname.decode(utf-8)) +host = db.host(hostname) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index cac733e..25347cb 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -47,13 +47,13 @@ class StormBuild(Build): __storm_table__ = build id = Int(primary=True) -tree = Unicode() +tree = RawStr() revision = RawStr() -host = Unicode() -compiler = Unicode() +host = RawStr() +compiler = RawStr() checksum = RawStr() age = Int() -status_str = Unicode(name=status) +status_str = RawStr(name=status) commit_revision = RawStr() def status(self): @@ -73,7 +73,7 @@ class StormBuild(Build): class StormHost(Host): __storm_table__ = host -name = Unicode(primary=True) +name = RawStr(primary=True) owner_name = Unicode(name=owner) owner_email = Unicode() password = Unicode() @@ -111,7 +111,7 @@ class StormHostDatabase(HostDatabase): def createhost(self, name, platform=None, owner=None, owner_email=None, password=None, permission=None): See `HostDatabase.createhost`. -newhost = StormHost(unicode(name), owner=owner, owner_email=owner_email, password=password, permission=permission, platform=platform) +newhost = StormHost(name, owner=owner, owner_email=owner_email, password=password, permission=permission, platform=platform) try: self.store.add(newhost) self.store.flush() @@ -153,18 +153,18 @@ class StormCachingBuildResultStore(BuildResultStore): def get_previous_revision(self, tree, host, compiler, revision): result = self.store.find(StormBuild, -StormBuild.tree == unicode(tree), -StormBuild.host == unicode(host), -StormBuild.compiler == unicode(compiler), +StormBuild.tree == tree, +StormBuild.host == host, +StormBuild.compiler == compiler, StormBuild.commit_revision == revision) cur_build = result.any() if cur_build is None: raise NoSuchBuildError(tree, host, compiler, revision) result = self.store.find(StormBuild, -StormBuild.tree == unicode(tree), -StormBuild.host == unicode(host), -StormBuild.compiler == unicode(compiler), +StormBuild.tree == tree, +StormBuild.host == host, +StormBuild.compiler == compiler, StormBuild.commit_revision != revision, StormBuild.id cur_build.id) result
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 149f80f Don't unicode encode name. from a54c867 Store more as plain strings. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 149f80fa8e2961b131daf8d18207b6a30d6eb4d2 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:12:59 2010 +0100 Don't unicode encode name. --- Summary of changes: buildfarm/hostdb.py |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/hostdb.py b/buildfarm/hostdb.py index ed4e753..24186c2 100644 --- a/buildfarm/hostdb.py +++ b/buildfarm/hostdb.py @@ -125,7 +125,7 @@ class HostDatabase(object): Write out the web/ for host in self.hosts(): -yield %s: %s\n % (host.name.encode(utf-8), host.platform.encode(utf-8)) +yield %s: %s\n % (host.name, host.platform.encode(utf-8)) def commit(self): pass @@ -143,7 +143,7 @@ class PlainTextHostDatabase(HostDatabase): try: for l in f: (host, platform) = l.split(:, 1) -ret[host.decode(utf-8)] = platform.strip().decode(utf-8) +ret[host] = platform.strip().decode(utf-8) finally: f.close() return cls(ret) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via c28ce63 Re-enable unicode encoding (required for storm). from 149f80f Don't unicode encode name. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit c28ce631c5288e9ba3c8cbe8a7d8aca1c30a6988 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:18:32 2010 +0100 Re-enable unicode encoding (required for storm). --- Summary of changes: buildfarm/hostdb.py |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/hostdb.py b/buildfarm/hostdb.py index 24186c2..ed4e753 100644 --- a/buildfarm/hostdb.py +++ b/buildfarm/hostdb.py @@ -125,7 +125,7 @@ class HostDatabase(object): Write out the web/ for host in self.hosts(): -yield %s: %s\n % (host.name, host.platform.encode(utf-8)) +yield %s: %s\n % (host.name.encode(utf-8), host.platform.encode(utf-8)) def commit(self): pass @@ -143,7 +143,7 @@ class PlainTextHostDatabase(HostDatabase): try: for l in f: (host, platform) = l.split(:, 1) -ret[host] = platform.strip().decode(utf-8) +ret[host.decode(utf-8)] = platform.strip().decode(utf-8) finally: f.close() return cls(ret) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 6d5e8cb Remove more unicode decoding. from c28ce63 Re-enable unicode encoding (required for storm). http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 6d5e8cbb2863c6f984206c3bd1a9e517b326f9e7 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:19:48 2010 +0100 Remove more unicode decoding. --- Summary of changes: admin.py | 10 +- buildfarm/sqldb.py | 36 ++-- buildfarm/tests/test_hostdb.py | 28 ++-- buildfarm/web/__init__.py | 14 +++--- 4 files changed, 44 insertions(+), 44 deletions(-) Changeset truncated at 500 lines: diff --git a/admin.py b/admin.py index cc8edf9..79c6ce7 100755 --- a/admin.py +++ b/admin.py @@ -70,7 +70,7 @@ else: if op == remove: hostname = raw_input(Please enter hostname to delete: ) try: -db.deletehost(hostname) +db.deletehost(hostname.decode(utf-8)) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) @@ -81,7 +81,7 @@ if op == remove: elif op == modify: hostname = raw_input(Please enter hostname to modify: ) try: -host = db.host(hostname) +host = db.host(hostname.decode(utf-8)) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) @@ -108,7 +108,7 @@ elif op == modify: elif op == add: hostname = raw_input(Machine hostname: ) try: -db.host(hostname) +db.host(hostname.decode(utf-8)) except hostdb.NoSuchHost, e: pass else: @@ -129,7 +129,7 @@ elif op == add: line = raw_input() try: -db.createhost(hostname, platform.decode(utf-8), +db.createhost(hostname.decode(utf-8), platform.decode(utf-8), owner.decode(utf-8), owner_email.decode(utf-8), password.decode(utf-8), .join(permission).decode(utf-8, replace)) @@ -192,7 +192,7 @@ Thanks, your friendly Samba build farm administrator bu...@samba.org % owne elif op == info: hostname = raw_input(Hostname: ) try: -host = db.host(hostname) +host = db.host(hostname.decode(utf-8)) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index 25347cb..cac733e 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -47,13 +47,13 @@ class StormBuild(Build): __storm_table__ = build id = Int(primary=True) -tree = RawStr() +tree = Unicode() revision = RawStr() -host = RawStr() -compiler = RawStr() +host = Unicode() +compiler = Unicode() checksum = RawStr() age = Int() -status_str = RawStr(name=status) +status_str = Unicode(name=status) commit_revision = RawStr() def status(self): @@ -73,7 +73,7 @@ class StormBuild(Build): class StormHost(Host): __storm_table__ = host -name = RawStr(primary=True) +name = Unicode(primary=True) owner_name = Unicode(name=owner) owner_email = Unicode() password = Unicode() @@ -111,7 +111,7 @@ class StormHostDatabase(HostDatabase): def createhost(self, name, platform=None, owner=None, owner_email=None, password=None, permission=None): See `HostDatabase.createhost`. -newhost = StormHost(name, owner=owner, owner_email=owner_email, password=password, permission=permission, platform=platform) +newhost = StormHost(unicode(name), owner=owner, owner_email=owner_email, password=password, permission=permission, platform=platform) try: self.store.add(newhost) self.store.flush() @@ -153,18 +153,18 @@ class StormCachingBuildResultStore(BuildResultStore): def get_previous_revision(self, tree, host, compiler, revision): result = self.store.find(StormBuild, -StormBuild.tree == tree, -StormBuild.host == host, -StormBuild.compiler == compiler, +StormBuild.tree == unicode(tree), +StormBuild.host == unicode(host), +StormBuild.compiler == unicode(compiler), StormBuild.commit_revision == revision) cur_build = result.any() if cur_build is None: raise NoSuchBuildError(tree, host, compiler, revision) result = self.store.find(StormBuild, -StormBuild.tree == tree, -StormBuild.host == host, -StormBuild.compiler == compiler, +StormBuild.tree == unicode(tree), +StormBuild.host == unicode(host), +StormBuild.compiler == unicode(compiler), StormBuild.commit_revision != revision, StormBuild.id cur_build.id
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 3250896 Unicode encoding hostname if necessary. from 6d5e8cb Remove more unicode decoding. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 3250896b368cd839b1fa65fffdd0c1f168016cf3 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:20:45 2010 +0100 Unicode encoding hostname if necessary. --- Summary of changes: buildfarm/sqldb.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index cac733e..b452e42 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -129,7 +129,7 @@ class StormHostDatabase(HostDatabase): return self.store.find(StormHost).order_by(StormHost.name) def host(self, name): -ret = self.store.find(StormHost, StormHost.name==name).one() +ret = self.store.find(StormHost, StormHost.name==unicode(name)).one() if ret is None: raise NoSuchHost(name) return ret -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via f53728a Unicode encoding hostname if necessary. from 3250896 Unicode encoding hostname if necessary. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit f53728a8f2d615246751e272f3697203602baadc Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:21:48 2010 +0100 Unicode encoding hostname if necessary. --- Summary of changes: buildfarm/sqldb.py |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index b452e42..fdee2dd 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -210,9 +210,9 @@ class StormCachingBuildResultStore(BuildResultStore): def get_old_revs(self, tree, host, compiler): return self.store.find(StormBuild, -StormBuild.tree == tree, -StormBuild.host == host, -StormBuild.compiler == compiler).order_by(Desc(StormBuild.age)) +StormBuild.tree == unicode(tree), +StormBuild.host == unicode(host), +StormBuild.compiler == unicode(compiler)).order_by(Desc(StormBuild.age)) class StormCachingBuildFarm(BuildFarm): -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 2f13a56 Merge tests. via c6dfd79 add tests for get_old_revs. via d1e63ac Add hostdb.host() test. Improve unicode handling in web ui. from f53728a Unicode encoding hostname if necessary. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 2f13a563d49e4fd48c264850beadea43d4874be9 Merge: f53728a8f2d615246751e272f3697203602baadc c6dfd79f0f75c261e25ebf3692e25ff6c72f515c Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 17 01:28:40 2010 +0100 Merge tests. commit c6dfd79f0f75c261e25ebf3692e25ff6c72f515c Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 02:29:36 2010 +0100 add tests for get_old_revs. commit d1e63ac9f7a11aead688103a9e6fb4f98d4de482 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 02:11:04 2010 +0100 Add hostdb.host() test. Improve unicode handling in web ui. --- Summary of changes: buildfarm/data.py |3 +++ buildfarm/tests/test_data.py | 24 buildfarm/tests/test_hostdb.py |5 + 3 files changed, 32 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 750deac..5c7fe7f 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -209,6 +209,9 @@ class Build(object): self.compiler = compiler self.commit_revision = self.revision = rev +def __eq__(self, other): +return (self.log_checksum() == other.log_checksum()) + def __repr__(self): if self.revision is not None: return %s: revision %s of %s on %s using %s % (self.__class__.__name__, self.revision, self.tree, self.host, self.compiler) diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index e79224b..c8d50f4 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -140,6 +140,30 @@ BUILD COMMIT REVISION: myrev def test_get_latest_revision_none(self): self.assertRaises(data.NoSuchBuildError, self.x.get_latest_revision, tdb, charis, cc) +def test_get_old_revs_none(self): +self.assertEquals([], +list(self.x.get_old_revs(utdb, ucharis, ugcc))) + +def test_get_old_revs(self): +path = self.create_mock_logfile(tdb, charis, cc, +contents= +BUILD COMMIT REVISION: 12 +) +build = data.Build(path[:-4], tdb, charis, cc) +b1 = self.x.upload_build(build) +path = self.create_mock_logfile(tdb, charis, cc, +contents= +BUILD COMMIT REVISION: 15 +) +build = data.Build(path[:-4], tdb, charis, cc) +b2 = self.x.upload_build(build) +path = self.create_mock_logfile(tdb, charis, cc, +contents= +BUILD COMMIT REVISION: 15 +) +self.assertEquals([b1, b2], +list(self.x.get_old_revs(utdb, ucharis, ucc))) + class BuildResultStoreTests(BuildFarmTestCase,BuildResultStoreTestBase): diff --git a/buildfarm/tests/test_hostdb.py b/buildfarm/tests/test_hostdb.py index f50c568..ca406f4 100644 --- a/buildfarm/tests/test_hostdb.py +++ b/buildfarm/tests/test_hostdb.py @@ -41,6 +41,11 @@ class HostDatabaseTests(object): self.assertEquals(1, len(hosts)) self.assertEquals(charis, hosts[0].name) +def test_host(self): +newhost = self.db.createhost(ucharis, ulinux, uJelmer, ujel...@samba.org, ubla, uPemrission?) +samehost = self.db.host(ucharis) +self.assertEquals(samehost, newhost) + def test_create_already_exists(self): host = self.db.createhost(name=ufoo, owner=uJelmer, owner_email=ujel...@samba.org) self.assertRaises(hostdb.HostAlreadyExists, self.db.createhost, name=ufoo, -- build.samba.org
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c3e24bb heimdal_base: Fix include path so heim_threads.h can be found. via f7bccc6 smb_server: Build as shared module. via ee69c4f heimdal_base: Add missing dependency on replace. via f91b7b5 nbtd: Build service as shared module. from 88d694a waf: fixed configure again on RHEL5 http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c3e24bb89f8a50476ac809aaa3fee409e639b0d0 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 12:42:14 2010 +0100 heimdal_base: Fix include path so heim_threads.h can be found. Autobuild-User: Jelmer Vernooij jel...@samba.org Autobuild-Date: Mon Nov 15 12:26:53 UTC 2010 on sn-devel-104 commit f7bccc6628db5434c304bcf42eaa249e87ba1f08 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 12:41:58 2010 +0100 smb_server: Build as shared module. commit ee69c4f4b3d2012037887c4124dd376eebb2f0af Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 12:24:45 2010 +0100 heimdal_base: Add missing dependency on replace. commit f91b7b5dab904613bd48f663ba768521995ed9e6 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 12:23:46 2010 +0100 nbtd: Build service as shared module. --- Summary of changes: source4/heimdal_build/wscript_build |4 ++-- source4/nbt_server/wscript_build|3 ++- source4/rpc_server/wscript_build|2 +- source4/smb_server/wscript_build|2 +- source4/smbd/wscript_build | 10 +- source4/torture/wscript_build |2 +- 6 files changed, 12 insertions(+), 11 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build index 4d8459e..0ebb339 100644 --- a/source4/heimdal_build/wscript_build +++ b/source4/heimdal_build/wscript_build @@ -684,8 +684,8 @@ HEIMDAL_SUBSYSTEM('HEIMDAL_HCRYPTO', HEIMDAL_SUBSYSTEM('HEIMDAL_BASE', 'base/array.c base/bool.c base/dict.c base/heimbase.c base/string.c base/number.c base/null.c', -includes='../heimdal/base', -deps='roken' +includes='../heimdal/base ../heimdal/include', +deps='roken replace' ) diff --git a/source4/nbt_server/wscript_build b/source4/nbt_server/wscript_build index 6fe64a4..252a9b8 100644 --- a/source4/nbt_server/wscript_build +++ b/source4/nbt_server/wscript_build @@ -42,6 +42,7 @@ bld.SAMBA_MODULE('service_nbtd', source='nbt_server.c', subsystem='service', init_function='server_service_nbtd_init', - deps='NBT_SERVER process_model' + deps='NBT_SERVER process_model', + internal_module=False, ) diff --git a/source4/rpc_server/wscript_build b/source4/rpc_server/wscript_build index 97fd41c..29c1723 100644 --- a/source4/rpc_server/wscript_build +++ b/source4/rpc_server/wscript_build @@ -11,7 +11,7 @@ bld.SAMBA_SUBSYSTEM('DCERPC_COMMON', autoproto='common/proto.h', public_headers='common/common.h', header_path='dcerpc_server', - deps='ldb DCERPC_SHARE' + deps='ldb DCERPC_SHARE samba_server_gensec' ) diff --git a/source4/smb_server/wscript_build b/source4/smb_server/wscript_build index a9e150e..bdf6469 100644 --- a/source4/smb_server/wscript_build +++ b/source4/smb_server/wscript_build @@ -6,7 +6,7 @@ bld.SAMBA_MODULE('SERVICE_SMB', subsystem='service', init_function='server_service_smb_init', deps='SMB_SERVER netif shares samba-hostconfig', - internal_module=True + internal_module=False, ) diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build index 3a59049..0d91d41 100644 --- a/source4/smbd/wscript_build +++ b/source4/smbd/wscript_build @@ -1,11 +1,11 @@ #!/usr/bin/env python bld.SAMBA_LIBRARY('service', - source='service.c service_stream.c service_named_pipe.c service_task.c', - autoproto='service_proto.h', - deps='tevent MESSAGING samba_socket RPC_NDR_IRPC NDR_NAMED_PIPE_AUTH NAMED_PIPE_AUTH_TSTREAM gssapi credentials LIBTSOCKET LIBSAMBA_TSOCKET process_model', - private_library=True - ) + source='service.c service_stream.c service_named_pipe.c service_task.c', + autoproto='service_proto.h', + deps='tevent MESSAGING samba_socket RPC_NDR_IRPC NDR_NAMED_PIPE_AUTH NAMED_PIPE_AUTH_TSTREAM gssapi credentials LIBTSOCKET LIBSAMBA_TSOCKET process_model', + private_library=True + ) bld.SAMBA_SUBSYSTEM('PIDFILE', diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build index 9b802ef..e24e9f1 100644 --- a/source4/torture/wscript_build +++ b/source4/torture/wscript_build @@ -44,7 +44,7 @@ bld.SAMBA_MODULE('torture_rpc', autoproto='rpc/proto.h', subsystem='smbtorture
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 0baa292 Use rlimit. via b384226 Add build cgi script. from 4c30514 Implement sql-specific get_old_revs. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 0baa292e4a249522f569ea5dcb6f3468896717a9 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 14:20:15 2010 +0100 Use rlimit. commit b3842262e68aea66a1929ebb4c7aab56118e7883 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 13:25:37 2010 +0100 Add build cgi script. --- Summary of changes: web/build.py = buildfarm/web/__init__.py |6 - web/build.cgi | 35 + 2 files changed, 35 insertions(+), 6 deletions(-) rename web/build.py = buildfarm/web/__init__.py (99%) create mode 100644 web/build.cgi Changeset truncated at 500 lines: diff --git a/web/build.py b/buildfarm/web/__init__.py similarity index 99% rename from web/build.py rename to buildfarm/web/__init__.py index d4edffe..df5e608 100755 --- a/web/build.py +++ b/buildfarm/web/__init__.py @@ -30,8 +30,6 @@ # e.g. only broken builds or only builds that you care about. import os -import sys -sys.path.insert(0, os.path.join(os.path.dirname(__file__), ..)) from buildfarm import ( data, @@ -1067,7 +1065,3 @@ if __name__ == '__main__': httpd = make_server(address, int(port), standaloneApp) print Serving on %s:%d... % (address, int(port)) httpd.serve_forever() -else: -import wsgiref.handlers -handler = wsgiref.handlers.CGIHandler() -handler.run(buildApp) diff --git a/web/build.cgi b/web/build.cgi new file mode 100644 index 000..246fca2 --- /dev/null +++ b/web/build.cgi @@ -0,0 +1,35 @@ +#!/usr/bin/python +# This CGI script presents the results of the build_farm build + +# Copyright (C) Jelmer Vernooij jel...@samba.org 2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +import os +import sys +sys.path.insert(0, os.path.join(os.path.dirname(__file__), ..)) + +from buildfarm.filecache import CachingBuildFarm +from buildfarm.web import BuildFarmApp +import wsgiref.handlers +import resource + +resource.setrlimit(resource.RLIMIT_RSS, (30, -1)) +resource.setrlimit(resource.RLIMIT_DATA, (30, -1)) + +buildfarm = CachingBuildFarm() +buildApp = BuildFarmApp(buildfarm) +handler = wsgiref.handlers.CGIHandler() +handler.run(buildApp) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via bfd499b Simplify standalone code. from 711124c Fix build.cgi mode, ulimit. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit bfd499b73bc46d33e98092bd49d2c58badd24163 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 14:53:24 2010 +0100 Simplify standalone code. --- Summary of changes: buildfarm/web/__init__.py | 32 1 files changed, 12 insertions(+), 20 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 819b9bb..5f3b727 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -45,11 +45,9 @@ import re import time import wsgiref.util -webdir = os.path.dirname(__file__) -basedir = os.path.abspath(os.path.join(webdir, ..)) +webdir = os.path.abspath(os.path.join(os.path.dirname(__file__), .., .., web)) -UNPACKED_BASE = http://svn.samba.org/ftp/unpacked; GITWEB_BASE = http://gitweb.samba.org; HISTORY_HORIZON = 1000 @@ -917,12 +915,9 @@ class BuildFarmApp(object): def __init__(self, buildfarm): self.buildfarm = buildfarm -self.db = data.BuildResultStore(basedir) -self.hostsdb = buildfarm.hostdb -self.compilers = buildfarm.compilers # host.properties are unicode object and the framework expect string object -self.hosts = dict([(host.name.encode(utf-8), host) for host in self.hostsdb.hosts()]) +self.hosts = dict([(host.name.encode(utf-8), host) for host in self.buildfarm.hostdb.hosts()]) def main_menu(self): main page @@ -1037,23 +1032,20 @@ if __name__ == '__main__': buildfarm = CachingBuildFarm(cachedirname=opts.cachedirname) buildApp = BuildFarmApp(buildfarm) from wsgiref.simple_server import make_server +import mimetypes +mimetypes.init() def standaloneApp(environ, start_response): if environ['PATH_INFO']: -dir = os.path.join(os.path.dirname(__file__)) -if re.match(^/[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)?, environ['PATH_INFO']): -static_file = %s/%s % (dir, environ['PATH_INFO']) +m = re.match(^/([a-zA-Z0-9_-]+)(\.[a-zA-Z0-9_-]+)?, environ['PATH_INFO']) +if m: +static_file = os.path.join(webdir, m.group(1)+m.group(2)) if os.path.exists(static_file): -tab = environ['PATH_INFO'].split('.') -if len(tab) 1: -extension = tab[-1] -import mimetypes -mimetypes.init() -type = mimetypes.types_map[.%s % extension] -start_response('200 OK', [('Content-type', type)]) -data = open(static_file, 'rb').read() -yield data -return +type = mimetypes.types_map[m.group(2)] +start_response('200 OK', [('Content-type', type)]) +data = open(static_file, 'rb').read() +yield data +return yield .join(buildApp(environ, start_response)) try: (address, port) = opts.port.rsplit(:, 1) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via a6c0f05 Decode host names and platform name. via 938e2e7 Improve formatting in web output. from bfd499b Simplify standalone code. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit a6c0f05eb2109e994e614cfe290be608b07dffb0 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 15:09:14 2010 +0100 Decode host names and platform name. commit 938e2e76589364ca8c92228a70ad710f977d075c Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 15:03:43 2010 +0100 Improve formatting in web output. --- Summary of changes: buildfarm/hostdb.py |2 +- buildfarm/web/__init__.py | 32 2 files changed, 17 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/hostdb.py b/buildfarm/hostdb.py index 3d7029c..ed4e753 100644 --- a/buildfarm/hostdb.py +++ b/buildfarm/hostdb.py @@ -143,7 +143,7 @@ class PlainTextHostDatabase(HostDatabase): try: for l in f: (host, platform) = l.split(:, 1) -ret[host] = platform.strip() +ret[host.decode(utf-8)] = platform.strip().decode(utf-8) finally: f.close() return cls(ret) diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 5f3b727..33165dc 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -922,28 +922,28 @@ class BuildFarmApp(object): def main_menu(self): main page -yield form method='GET' -yield div id='build-menu' -yield select name='host' +yield form method='GET'\n +yield div id='build-menu'\n +yield select name='host'\n for name, host in self.hosts.iteritems(): yield option value='%s'%s -- %s/option\n % (name, host.platform.encode(utf-8), name) -yield /select -yield select name='tree' +yield /select\n +yield select name='tree'\n for tree, t in self.buildfarm.trees.iteritems(): yield option value='%s'%s:%s/option\n % (tree, tree, t.branch) -yield /select -yield select name='compiler' +yield /select\n +yield select name='compiler'\n for compiler in self.buildfarm.compilers: yield option%s/option\n % compiler -yield /select -yield br/ -yield input type='submit' name='function' value='View Build'/ -yield input type='submit' name='function' value='View Host'/ -yield input type='submit' name='function' value='Recent Checkins'/ -yield input type='submit' name='function' value='Summary'/ -yield input type='submit' name='function' value='Recent Builds'/ -yield /div -yield /form +yield /select\n +yield br/\n +yield input type='submit' name='function' value='View Build'/\n +yield input type='submit' name='function' value='View Host'/\n +yield input type='submit' name='function' value='Recent Checkins'/\n +yield input type='submit' name='function' value='Summary'/\n +yield input type='submit' name='function' value='Recent Builds'/\n +yield /div\n +yield /form\n def __call__(self, environ, start_response): form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 0cb42c2 Add buildfarm.web tests. via c9e91d3 Fix exception handling when both python-pysqlite2 and sqlite3 are installed. from a6c0f05 Decode host names and platform name. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 0cb42c2abd1c95df648dd359ef47a0ab4f1bd917 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 16:30:50 2010 +0100 Add buildfarm.web tests. commit c9e91d3e26de7183996455148920fb1c20163fd2 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 16:30:36 2010 +0100 Fix exception handling when both python-pysqlite2 and sqlite3 are installed. --- Summary of changes: buildfarm/sqldb.py|4 +- buildfarm/web/__init__.py | 71 +++-- web/build.cgi = buildfarm/web/tests/test_util.py | 26 +++- 3 files changed, 49 insertions(+), 52 deletions(-) create mode 100644 buildfarm/web/tests/__init__.py copy web/build.cgi = buildfarm/web/tests/test_util.py (55%) mode change 100755 = 100644 Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index 8c5330f..e0ef491 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -35,9 +35,9 @@ from buildfarm.hostdb import ( import os try: -import sqlite3 -except ImportError: from pysqlite2 import dbapi2 as sqlite3 +except ImportError: +import sqlite3 from storm.database import create_database from storm.locals import Bool, Desc, Int, Unicode, RawStr from storm.store import Store diff --git a/buildfarm/web/__init__.py b/buildfarm/web/__init__.py index 33165dc..dda4b17 100755 --- a/buildfarm/web/__init__.py +++ b/buildfarm/web/__init__.py @@ -682,6 +682,41 @@ class ViewRecentBuildsPage(BuildFarmPage): class ViewHostPage(BuildFarmPage): +def _render_build(self, myself, build): +try: +(revision, revision_time) = build.revision_details() +except data.MissingRevisionInfo: +revision = None +age_mtime = build.age_mtime() +age_ctime = build.age_ctime() +warnings = build.err_count() +status = build_status_html(myself, build) +if row == 0: +if output_type == 'text': +yield %-12s %-10s %-10s %-10s %-10s\n % ( +Tree, Compiler, Build Age, Status, Warnings) +else: +yield div class='host summary' +yield a id='host' name='host'/ +yield h3%s - %s/h3 % (host, self.buildfarm.hostdb.host(host).platform.encode(utf-8)) +yield table class='real' +yield theadtrthTarget/ththBuildbr/Revision/ththBuildbr /Age/ththStatusbr /config/buildbr /install/test/ththWarnings/th/tr/thead +yield tbody + +if output_type == 'text': +yield %-12s %-10s %-10s %-10s %-10s\n % ( +tree, compiler, util.dhm_time(age_mtime), +util.strip_html(status), warnings) +else: +yield tr +yield tdspan class='tree' + self.tree_link(myself, tree) +/span/ + compiler + /td +yield td + revision_link(myself, revision, tree) + /td +yield tddiv class='age' + self.red_age(age_mtime) + /div/td +yield tddiv class='status'%s/div/td % status +yield td%s/td % warnings +yield /tr +row+=1 + def render(self, myself, output_type, *requested_hosts): print the host's table of information @@ -699,7 +734,6 @@ class ViewHostPage(BuildFarmPage): continue row = 0 - for compiler in self.buildfarm.compilers: for tree in sorted(self.buildfarm.trees.keys()): try: @@ -707,39 +741,8 @@ class ViewHostPage(BuildFarmPage): except data.NoSuchBuildError: pass else: -try: -(revision, revision_time) = build.revision_details() -except data.MissingRevisionInfo: -revision = None -age_mtime = build.age_mtime() -age_ctime = build.age_ctime() -warnings = build.err_count() -status = build_status_html(myself, build) -if row == 0: -if output_type == 'text': -yield %-12s %-10s %-10s %-10s %-10s\n % ( -Tree, Compiler, Build Age, Status, Warnings) -else: -yield div class='host summary' -yield a id='host' name
[SCM] build.samba.org - branch master updated
The branch, master has been updated via aca1062 Cope with revision info not being present when displaying items in the web view. from 4bfd615 Fix nasty gram sending. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit aca1062fa087dfe02a5cfacdcc35faa4ee24805e Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 16:08:41 2010 +0100 Cope with revision info not being present when displaying items in the web view. --- Summary of changes: web/build.py | 29 +++-- 1 files changed, 19 insertions(+), 10 deletions(-) Changeset truncated at 500 lines: diff --git a/web/build.py b/web/build.py index be6b830..d4edffe 100755 --- a/web/build.py +++ b/web/build.py @@ -134,10 +134,10 @@ def build_status_vals(status): def revision_link(myself, revision, tree): return a link to a particular revision -revision = revision.lstrip() -if revision == 0: -return 0 +if revision is None: +return unknown +revision = revision.lstrip() rev_short = revision if len(revision) == 40: rev_short = re.sub((^.{7}).*, \\1(git), rev_short) @@ -478,10 +478,9 @@ class ViewBuildPage(BuildFarmPage): yield tbody for build in old_rev_builds: -revision = build.revision yield trtd%s/tdtd%s/td/tr % ( -revision_link(myself, revision, tree), -build_link(myself, tree, host, compiler, revision, +revision_link(myself, build.revision, tree), +build_link(myself, tree, host, compiler, build.revision, html_build_status(build.status( yield /tbody/table @@ -498,7 +497,11 @@ class ViewBuildPage(BuildFarmPage): config = build = buildfarm.get_build(tree, host, compiler, rev) age_mtime = build.age_mtime() -(revision, revision_time) = build.revision_details() +try: +(revision, revision_time) = build.revision_details() +except data.MissingRevisionInfo: +revision = None + status = build_status_html(myself, build) if rev: @@ -633,8 +636,11 @@ class ViewRecentBuildsPage(BuildFarmPage): else: age_mtime = build.age_mtime() age_ctime = build.age_ctime() -(revision, revision_time) = build.revision_details() -if revision: +try: +(revision, revision_time) = build.revision_details() +except data.MissingRevisionInfo: +pass +else: all_builds.append([ age_ctime, host.platform.encode(utf-8), @@ -705,7 +711,10 @@ class ViewHostPage(BuildFarmPage): except data.NoSuchBuildError: pass else: -(revision, revision_time) = build.revision_details() +try: +(revision, revision_time) = build.revision_details() +except data.MissingRevisionInfo: +revision = None age_mtime = build.age_mtime() age_ctime = build.age_ctime() warnings = build.err_count() -- build.samba.org
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f0cdcd9 web_server: Build as module. via f5fbba7 kcc/drepl: Build as service. via f6c8bc6 winbind: Build as shared module. via bee3b66 Build wrepl server as service by default. via 6d1d146 Add myself as maintainer for pytevent, pytalloc, pytdb and pyldb. via 6e762f9 Re-enable ldb-cmdline for the moment, as it is used by oLschema2ldif. via d2dfa86 Don't build ldb tools when there is a system provided ldb. from c52e6db s3: string_to_sid does thorough syntax checking http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f0cdcd940e20bf049ccb19ca68a101a29d2ee8d1 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 17:36:51 2010 +0100 web_server: Build as module. Autobuild-User: Jelmer Vernooij jel...@samba.org Autobuild-Date: Sun Nov 14 17:58:05 UTC 2010 on sn-devel-104 commit f5fbba76c8743d6c4f25b9850e2c2c4353730cdf Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 17:31:26 2010 +0100 kcc/drepl: Build as service. commit f6c8bc6a7bfac1cb13fdf2a4dc76c3d1234de73f Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 17:26:29 2010 +0100 winbind: Build as shared module. commit bee3b665a882b03ae6c65de6b9440e1b00994080 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 17:09:34 2010 +0100 Build wrepl server as service by default. commit 6d1d146e8987f515f97b1fa1ef6f726f2c60a884 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 14:49:03 2010 +0100 Add myself as maintainer for pytevent, pytalloc, pytdb and pyldb. commit 6e762f90030b214a24bfae5cf048fad9893f53c8 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 14:32:13 2010 +0100 Re-enable ldb-cmdline for the moment, as it is used by oLschema2ldif. commit d2dfa868fd7e77879ff40b7bbe3b52a0ceece277 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 14 13:40:58 2010 +0100 Don't build ldb tools when there is a system provided ldb. --- Summary of changes: MAINTAINERS.txt|9 - source4/dsdb/wscript_build | 12 +++- source4/kdc/wscript_build |2 +- source4/lib/ldb/wscript| 18 +- source4/ntp_signd/wscript_build|3 ++- source4/web_server/web_server.h| 11 +-- source4/web_server/wscript_build |3 +-- source4/web_server/wsgi.c |8 source4/winbind/wscript_build |5 +++-- source4/wrepl_server/wscript_build |3 ++- 10 files changed, 46 insertions(+), 28 deletions(-) Changeset truncated at 500 lines: diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt index cab674e..08e7626 100644 --- a/MAINTAINERS.txt +++ b/MAINTAINERS.txt @@ -38,8 +38,15 @@ policy: and review by all maintainers. +files: lib/tevent/py*, lib/talloc/py*, source4/lib/ldb/py*, lib/tdb/py* +maintainers: + Jelmer Vernooij jel...@samba.org +policy: + Larger commits require pre-push review by the maintainer or + one of the maintainers of the containing subsystem. - + Other non-trivial (typo, etc) commits require pre- or post-push review by the + maintainer or one of the maintainers of the containing subsystem. === diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build index 199555b..3a09fc4 100644 --- a/source4/dsdb/wscript_build +++ b/source4/dsdb/wscript_build @@ -26,25 +26,27 @@ bld.SAMBA_SUBSYSTEM('SAMDB_SCHEMA', ) -bld.SAMBA_MODULE('DREPL_SRV', +bld.SAMBA_MODULE('service_drepl', source='repl/drepl_service.c repl/drepl_periodic.c repl/drepl_partitions.c repl/drepl_out_pull.c repl/drepl_out_helpers.c repl/drepl_notify.c repl/drepl_ridalloc.c repl/drepl_extended.c repl/drepl_fsmo.c repl/drepl_secret.c repl/drepl_replica.c', autoproto='repl/drepl_service_proto.h', subsystem='service', init_function='server_service_drepl_init', - deps='samdb process_model RPC_NDR_DRSUAPI' + deps='samdb process_model RPC_NDR_DRSUAPI', + internal_module=False, ) -bld.SAMBA_MODULE('KCC_SRV', +bld.SAMBA_MODULE('service_kcc', source='kcc/kcc_service.c kcc/kcc_connection.c kcc/kcc_topology.c kcc/kcc_deleted.c kcc/kcc_periodic.c kcc/kcc_drs_replica_info.c', autoproto='kcc/kcc_service_proto.h', subsystem='service', init_function='server_service_kcc_init', - deps='samdb process_model RPC_NDR_IRPC RPC_NDR_DRSUAPI' + deps='samdb process_model RPC_NDR_IRPC RPC_NDR_DRSUAPI', + internal_module=False, ) -bld.SAMBA_MODULE('dns_update_srv', +bld.SAMBA_MODULE('service_dns_update', source='dns/dns_update.c', subsystem='service', init_function
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 6a85d8c Support passing timeout to the StormCachingBuildFarm. from aca1062 Cope with revision info not being present when displaying items in the web view. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 6a85d8c6cada716c6f15ade8d0120054506dc261 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 01:37:13 2010 +0100 Support passing timeout to the StormCachingBuildFarm. --- Summary of changes: buildfarm/sqldb.py| 13 +++-- import-and-analyse.py |2 +- mail-dead-hosts.py|2 +- 3 files changed, 9 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index 709784f..faf3cbf 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -199,18 +199,19 @@ class StormCachingBuildResultStore(BuildResultStore): class StormCachingBuildFarm(BuildFarm): -def __init__(self, path=None, store=None): +def __init__(self, path=None, store=None, timeout=0.5): +self.timeout = timeout self.store = store super(StormCachingBuildFarm, self).__init__(path) def _get_store(self): if self.store is not None: return self.store -else: -db = create_database(sqlite: + os.path.join(self.path, hostdb.sqlite)) -self.store = Store(db) -setup_schema(self.store) -return self.store +db_path = os.path.join(self.path, hostdb.sqlite) +db = create_database(sqlite:%s?timeout=%f % (db_path, self.timeout)) +self.store = Store(db) +setup_schema(self.store) +return self.store def _open_hostdb(self): return StormHostDatabase(self._get_store()) diff --git a/import-and-analyse.py b/import-and-analyse.py index d88ef43..f6f0c2c 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -23,7 +23,7 @@ parser.add_option(--verbose, help=Be verbose, action=count) (opts, args) = parser.parse_args() -buildfarm = StormCachingBuildFarm() +buildfarm = StormCachingBuildFarm(timeout=40.0) smtp = smtplib.SMTP() smtp.connect() diff --git a/mail-dead-hosts.py b/mail-dead-hosts.py index 8300ba0..2e0c7f7 100755 --- a/mail-dead-hosts.py +++ b/mail-dead-hosts.py @@ -27,7 +27,7 @@ parser = optparse.OptionParser() parser.add_option(--dry-run, help=Don't actually send any emails., action=store_true) (opts, args) = parser.parse_args() -buildfarm = StormCachingBuildFarm() +buildfarm = StormCachingBuildFarm(timeout=40.0) db = buildfarm.hostdb smtp = smtplib.SMTP() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 42e888a Move hostdb to a separate db directory. from 6a85d8c Support passing timeout to the StormCachingBuildFarm. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 42e888aa3a8bcdf2525cc6739339aa647d77f584 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 01:39:18 2010 +0100 Move hostdb to a separate db directory. --- Summary of changes: buildfarm/sqldb.py |2 +- buildfarm/tests/__init__.py |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index faf3cbf..dc506f0 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -207,7 +207,7 @@ class StormCachingBuildFarm(BuildFarm): def _get_store(self): if self.store is not None: return self.store -db_path = os.path.join(self.path, hostdb.sqlite) +db_path = os.path.join(self.path, db, hostdb.sqlite) db = create_database(sqlite:%s?timeout=%f % (db_path, self.timeout)) self.store = Store(db) setup_schema(self.store) diff --git a/buildfarm/tests/__init__.py b/buildfarm/tests/__init__.py index fb98f55..b3226d5 100644 --- a/buildfarm/tests/__init__.py +++ b/buildfarm/tests/__init__.py @@ -80,10 +80,10 @@ class BuildFarmTestCase(TestCase): super(BuildFarmTestCase, self).setUp() self.path = tempfile.mkdtemp() -for subdir in [data, data/upload, data/oldrevs, cache, web, lcov, lcov/data]: +for subdir in [data, data/upload, data/oldrevs, db, cache, web, lcov, lcov/data]: os.mkdir(os.path.join(self.path, subdir)) -db = database.create_database(sqlite:+os.path.join(self.path, hostdb.sqlite)) +db = database.create_database(sqlite:+os.path.join(self.path, db, hostdb.sqlite)) store = Store(db) setup_schema(store) store.flush() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 2641334 Add missing extensions for git repositories. from 42e888a Move hostdb to a separate db directory. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 26413342c87799f11dcb05915d44e0a871577dfe Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 01:42:47 2010 +0100 Add missing extensions for git repositories. --- Summary of changes: web/trees.conf |8 1 files changed, 4 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/web/trees.conf b/web/trees.conf index 1a72568..6c4f9c3 100644 --- a/web/trees.conf +++ b/web/trees.conf @@ -1,21 +1,21 @@ [ccache] scm = git -repo = ccache +repo = ccache.git branch = master [ccache-maint] scm = git -repo = ccache +repo = ccache.git branch = maint [ppp] scm = git -repo = ppp +repo = ppp.git branch = master [samba-web] scm = git -repo = samba-web +repo = samba-web.git branch = trunk [samba_3_current] -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 73afd26 Actually use sqldb. from 2641334 Add missing extensions for git repositories. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 73afd267aae1ebbdda438fd57d2ffddfbaa7f71c Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 01:51:02 2010 +0100 Actually use sqldb. --- Summary of changes: buildfarm/data.py |7 +++ buildfarm/filecache.py |4 ++-- buildfarm/sqldb.py |9 - 3 files changed, 17 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 5c25aab..36c3424 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -61,6 +61,13 @@ class BuildStatus(object): else: self.other_failures = set() +def __serialize__(self): +return repr(self) + +@classmethod +def __deserialize__(cls, text): +return eval(text) + def __str__(self): if self.other_failures: return ,.join(self.other_failures) diff --git a/buildfarm/filecache.py b/buildfarm/filecache.py index d9c4a16..bd15d5f 100644 --- a/buildfarm/filecache.py +++ b/buildfarm/filecache.py @@ -100,12 +100,12 @@ class CachingBuild(Build): st2 = None if st2 and st1.st_ctime = st2.st_mtime: -return eval(util.FileLoad(cachefile)) +return BuildStatus.__deserialize__(util.FileLoad(cachefile)) ret = super(CachingBuild, self).status() if not self._store.readonly: -util.FileSave(cachefile, repr(ret)) +util.FileSave(cachefile, ret.__serialize__()) return ret diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index dc506f0..a2c424a 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -23,6 +23,7 @@ from buildfarm import ( from buildfarm.data import ( Build, BuildResultStore, +BuildStatus, NoSuchBuildError, ) from buildfarm.hostdb import ( @@ -55,6 +56,12 @@ class StormBuild(Build): status_str = Unicode(name=status) commit_revision = RawStr() +def status(self): +return BuildStatus.__deserialize__(self.status_str) + +def revision_details(self): +return (self.commit_revision, None) + def log_checksum(self): return self.checksum @@ -192,7 +199,7 @@ class StormCachingBuildResultStore(BuildResultStore): new_build = StormBuild(new_basename, unicode(build.tree), unicode(build.host), unicode(build.compiler), rev) new_build.checksum = build.log_checksum() new_build.age = build.age_mtime() -new_build.status_str = unicode(str(build.status())) +new_build.status_str = unicode(build.status().__serialize__()) self.store.add(new_build) return new_build -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 4c30514 Implement sql-specific get_old_revs. from 73afd26 Actually use sqldb. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 4c305147f34d899cf791c9c8ab103ec7ff3247bb Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 01:57:33 2010 +0100 Implement sql-specific get_old_revs. --- Summary of changes: buildfarm/sqldb.py |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index a2c424a..8c5330f 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -203,6 +203,12 @@ class StormCachingBuildResultStore(BuildResultStore): self.store.add(new_build) return new_build +def get_old_revs(self, tree, host, compiler): +return self.store.find(StormBuild, +StormBuild.tree == tree, +StormBuild.host == host, +StormBuild.compiler == compiler).order_by(Desc(StormBuild.age)) + class StormCachingBuildFarm(BuildFarm): -- build.samba.org
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 13fd22f s4/dns: Build as shared module. from 2d7dc86 s4-kdc: if bind interfaces only is false, then also listen on wildcard http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 13fd22f61017124d2d4964db3e32c667d119b56c Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 00:44:30 2010 +0100 s4/dns: Build as shared module. Autobuild-User: Jelmer Vernooij jel...@samba.org Autobuild-Date: Mon Nov 15 00:57:27 UTC 2010 on sn-devel-104 --- Summary of changes: source4/dns_server/wscript_build |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/dns_server/wscript_build b/source4/dns_server/wscript_build index 3a0f289..f19a5a2 100644 --- a/source4/dns_server/wscript_build +++ b/source4/dns_server/wscript_build @@ -1,9 +1,10 @@ #!/usr/bin/env python -bld.SAMBA_MODULE('DNS', +bld.SAMBA_MODULE('service_dns', source='dns_server.c dns_query.c dns_update.c dns_utils.c', subsystem='service', init_function='server_service_dns_init', deps='samba-hostconfig LIBTSOCKET LIBSAMBA_TSOCKET ldbsamba', -local_include=False +local_include=False, +internal_module=False, ) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 1409c97 s4: Build ldap and samba3_smb services as shared modules. via 02f7721 cldap: Build as shared module. via caa3935 kdc: Build as shared module by default. via e422c2a auth/ntlm: Use name consistent with other service names. from 02d3203 auth/gensec Handle incorrect username or password in Kerberos client code http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1409c97899406d48f5b763fc88389bab11e379fc Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 03:19:44 2010 +0100 s4: Build ldap and samba3_smb services as shared modules. Autobuild-User: Jelmer Vernooij jel...@samba.org Autobuild-Date: Mon Nov 15 03:04:41 UTC 2010 on sn-devel-104 commit 02f77214c2372b33d9b3e6c4075069aa6fae0b9b Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 03:14:16 2010 +0100 cldap: Build as shared module. commit caa3935a388da986e84bc36488227c746ed1fe34 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 00:46:12 2010 +0100 kdc: Build as shared module by default. commit e422c2a4a5f491fa6227decbff38445c2e191140 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 15 00:45:48 2010 +0100 auth/ntlm: Use name consistent with other service names. --- Summary of changes: source4/auth/ntlm/wscript_build|2 +- source4/cldap_server/wscript_build |1 + source4/kdc/wscript_build |1 + source4/ldap_server/wscript_build |3 ++- source4/ntp_signd/wscript_build|2 +- source4/rpc_server/wscript_build |2 +- source4/smb_server/wscript_build |5 +++-- source4/web_server/wscript_build |2 +- 8 files changed, 11 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/auth/ntlm/wscript_build b/source4/auth/ntlm/wscript_build index 3dc9b97..8063076 100644 --- a/source4/auth/ntlm/wscript_build +++ b/source4/auth/ntlm/wscript_build @@ -61,7 +61,7 @@ bld.SAMBA_LIBRARY('auth', private_library=True ) -bld.SAMBA_MODULE('auth_server_service', +bld.SAMBA_MODULE('service_auth', source='auth_server_service.c', subsystem='service', init_function='server_service_auth_init', diff --git a/source4/cldap_server/wscript_build b/source4/cldap_server/wscript_build index 7b32912..f105c0e 100644 --- a/source4/cldap_server/wscript_build +++ b/source4/cldap_server/wscript_build @@ -4,6 +4,7 @@ bld.SAMBA_MODULE('service_cldap', source='cldap_server.c', subsystem='service', init_function='server_service_cldapd_init', + internal_module=False, deps='CLDAPD process_model netif' ) diff --git a/source4/kdc/wscript_build b/source4/kdc/wscript_build index 9e2c50e..82b9929 100644 --- a/source4/kdc/wscript_build +++ b/source4/kdc/wscript_build @@ -5,6 +5,7 @@ bld.SAMBA_MODULE('service_kdc', subsystem='service', init_function='server_service_kdc_init', deps='kdc HDB_SAMBA4 WDC_SAMBA4 samba-hostconfig LIBTSOCKET LIBSAMBA_TSOCKET com_err samba_server_gensec', + internal_module=False, ) diff --git a/source4/ldap_server/wscript_build b/source4/ldap_server/wscript_build index f089c5e..c5fe13d 100644 --- a/source4/ldap_server/wscript_build +++ b/source4/ldap_server/wscript_build @@ -6,6 +6,7 @@ bld.SAMBA_MODULE('LDAP', autoproto='proto.h', subsystem='service', init_function='server_service_ldap_init', - deps='credentials cli-ldap samdb process_model gensec samba-hostconfig samba_server_gensec' + deps='credentials cli-ldap samdb process_model gensec samba-hostconfig samba_server_gensec', + internal_module=False, ) diff --git a/source4/ntp_signd/wscript_build b/source4/ntp_signd/wscript_build index 1b82bc6..ad12925 100644 --- a/source4/ntp_signd/wscript_build +++ b/source4/ntp_signd/wscript_build @@ -1,6 +1,6 @@ #!/usr/bin/env python -bld.SAMBA_MODULE('NTP_SIGND', +bld.SAMBA_MODULE('service_ntp_signd', source='ntp_signd.c', subsystem='service', init_function='server_service_ntp_signd_init', diff --git a/source4/rpc_server/wscript_build b/source4/rpc_server/wscript_build index 7f73d96..97fd41c 100644 --- a/source4/rpc_server/wscript_build +++ b/source4/rpc_server/wscript_build @@ -140,7 +140,7 @@ bld.SAMBA_LIBRARY('dcerpc_server', vnum='0.0.1' ) -bld.SAMBA_MODULE('dcesrv', +bld.SAMBA_MODULE('service_dcerpc', source='service_rpc.c', autoproto='service_rpc.h', subsystem='service', diff --git a/source4/smb_server/wscript_build b/source4/smb_server/wscript_build index 7ccfeec..a9e150e 100644 --- a/source4/smb_server/wscript_build +++ b/source4/smb_server/wscript_build @@ -10,11 +10,12 @@ bld.SAMBA_MODULE('SERVICE_SMB', ) -bld.SAMBA_MODULE
[SCM] build.samba.org - branch master updated
The branch, master has been updated via e4024b8 Various fixes found during ad-hoc testing. via e771174 Add convenience function for avoiding database. Move database code to separate module. via d4df7e4 Fix some formatting. via ff7cecb More fixes for import-and-analyse. via 1ca3392 Use named tuples, some more fixes for hostdb. via ae0821a Warn early when creating host that already exists, move some storm code around. via 99f99ba Move some functionality to Host. via b26943a More storm usage. via 549ef86 Use storm in host database. via af937d5 Use storm to find builds. via 75f1b64 Remove unecessary argument from Build(). via 75e2697 use storm. from 2a37ec3 Be verbose when there's no previous build. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit e4024b82466d4b4966a4ac21ec0884cc296bf984 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 13:08:07 2010 +0100 Various fixes found during ad-hoc testing. commit e77117456e12043754d1da19e19880d1c5899722 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 06:40:18 2010 +0100 Add convenience function for avoiding database. Move database code to separate module. commit d4df7e442cb6acd8a4aacd8135a1b38c159925bc Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 06:05:10 2010 +0100 Fix some formatting. commit ff7cecb4b0af868781a1a84563bc78921a250588 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 05:49:39 2010 +0100 More fixes for import-and-analyse. commit 1ca339299de89b486979c73222e9faa9ead01b7e Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 05:24:47 2010 +0100 Use named tuples, some more fixes for hostdb. commit ae0821a89cfc6810c4410f9f1db26d629c7ee41d Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 05:11:05 2010 +0100 Warn early when creating host that already exists, move some storm code around. commit 99f99bab13945b6d6cdd499ecfdae845e08d8ad1 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 04:43:47 2010 +0100 Move some functionality to Host. commit b26943a223f8215cf132c0176a0f1385d66d1f7c Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 04:16:47 2010 +0100 More storm usage. commit 549ef86335847197cc58ddca5dc4d407f925814f Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 04:09:04 2010 +0100 Use storm in host database. commit af937d5dc9d2c68aa0b69f7247e59ad0320ec570 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 03:50:04 2010 +0100 Use storm to find builds. commit 75f1b64035ab24de2dcd38e5d0d914cb992cb2b7 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 03:09:46 2010 +0100 Remove unecessary argument from Build(). commit 75e2697b4116421545c64780fc4610c636461891 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 02:55:39 2010 +0100 use storm. --- Summary of changes: admin.py | 46 +--- buildfarm/__init__.py | 36 +- buildfarm/data.py | 128 -- buildfarm/hostdb.py | 117 +++- buildfarm/sqldb.py| 217 + buildfarm/tests/__init__.py | 19 +++- buildfarm/tests/test_buildfarm.py |9 +-- buildfarm/tests/test_data.py | 33 +-- buildfarm/tests/test_hostdb.py| 67 +--- buildfarm/tests/test_sqldb.py | 78 + import-and-analyse.py |9 +- mail-dead-hosts.py| 11 +- web/build.py | 41 13 files changed, 517 insertions(+), 294 deletions(-) create mode 100644 buildfarm/sqldb.py create mode 100644 buildfarm/tests/test_sqldb.py Changeset truncated at 500 lines: diff --git a/admin.py b/admin.py index f17b26e..79c6ce7 100755 --- a/admin.py +++ b/admin.py @@ -70,16 +70,21 @@ else: if op == remove: hostname = raw_input(Please enter hostname to delete: ) try: -db.deletehost(hostname) +db.deletehost(hostname.decode(utf-8)) except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) else: +db.commit() update_rsyncd_secrets() update_hosts_list() elif op == modify: hostname = raw_input(Please enter hostname to modify: ) -host = db.host(hostname) +try: +host = db.host(hostname.decode(utf-8)) +except hostdb.NoSuchHost, e: +print No such host '%s' % e.name +sys.exit(1) print Owner: %s %s % host.owner print Platform: %s % host.platform print @@ -88,19 +93,13 @@ elif op == modify: mod_op = platform if mod_op == platform: platform = raw_input(Enter new platform: ) -try
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 1a6118b Support overriding cache page on command line for web/build.py Put pages into a separate class. Several other fixes. from e4024b8 Various fixes found during ad-hoc testing. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 1a6118b447040ec837cba9e7c832f779a3a548e6 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 13:55:45 2010 +0100 Support overriding cache page on command line for web/build.py Put pages into a separate class. Several other fixes. --- Summary of changes: buildfarm/history.py |2 +- web/build.py | 1204 ++ 2 files changed, 620 insertions(+), 586 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/history.py b/buildfarm/history.py index 537ce48..d52bec1 100644 --- a/buildfarm/history.py +++ b/buildfarm/history.py @@ -106,5 +106,5 @@ class GitBranch(object): commit = self.repo[revision] f = StringIO() for (oldpath, newpath), (oldmode, newmode), (oldsha, newsha) in self._changes_for(commit): -write_blob_diff((oldpath, oldmode, self.store[oldsha]), (newpath, newmode, self.store[newsha])) +write_blob_diff(f, (oldpath, oldmode, self.store[oldsha]), (newpath, newmode, self.store[newsha])) return (self._revision_from_commit(commit), f.getvalue()) diff --git a/web/build.py b/web/build.py index dc1ddb1..f8d74d5 100755 --- a/web/build.py +++ b/web/build.py @@ -1,12 +1,16 @@ #!/usr/bin/python # This CGI script presents the results of the build_farm build + +# Copyright (C) Jelmer Vernooij jel...@samba.org 2010 +# Copyright (C) Matthieu Patou m...@matws.net 2010 +# +# Based on the original web/build.pl: # # Copyright (C) Andrew Tridgell tri...@samba.org 2001-2005 # Copyright (C) Andrew Bartlett abart...@samba.org 2001 # Copyright (C) Vance Lankhaar va...@samba.org 2002-2005 # Copyright (C) Martin Pool m...@samba.org2001 -# Copyright (C) Jelmer Vernooij jel...@samba.org 2007-2010 -# Copyright (C) Matthieu Patou m...@matws.net 2010-2010 +# Copyright (C) Jelmer Vernooij jel...@samba.org 2007 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,6 +36,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ..)) from buildfarm import ( CachingBuildFarm, data, +hostdb, util, ) @@ -44,16 +49,6 @@ standalone = 0 webdir = os.path.dirname(__file__) basedir = os.path.abspath(os.path.join(webdir, ..)) -buildfarm = CachingBuildFarm() - -db = data.BuildResultStore(basedir) -hostsdb = buildfarm.hostdb - -compilers = buildfarm.compilers -# host.properties are unicode object and the framework expect string object -hosts = dict([(host.name.encode(utf-8), host) for host in hostsdb.hosts()]) -trees = buildfarm.trees -OLDAGE = buildfarm.OLDAGE UNPACKED_BASE = http://svn.samba.org/ftp/unpacked; GITWEB_BASE = http://gitweb.samba.org; @@ -123,13 +118,6 @@ def build_status_html(myself, build): return build_link(myself, build.tree, build.host, build.compiler, build.revision, status) -def red_age(age): -show an age as a string -if age OLDAGE: -return span clsas='old'%s/span % util.dhm_time(age) -return util.dhm_time(age) - - def build_status_vals(status): translate a status into a set of int representing status status = util.strip_html(status) @@ -142,89 +130,6 @@ def build_status_vals(status): return status.split(/) -def view_summary(myself, output_type): -view build summary -i = 0 -cols = 2 -broken = 0 -broken_count = {} -panic_count = {} -host_count = {} - -# zero broken and panic counters -for tree in trees: -broken_count[tree] = 0 -panic_count[tree] = 0 -host_count[tree] = 0 - -# set up a variable to store the broken builds table's code, so we can -# output when we want -broken_table = -last_host = - -# for the text report, include the current time -if output_type == 'text': -t = time.gmtime() -yield Build status as of %s\n\n % t - -for host in hosts.values(): -for compiler in compilers: -for tree in trees: -try: -build = buildfarm.get_build(tree, host.name.encode(utf-8), compiler) -status = build_status_html(myself, build) -except data.NoSuchBuildError: -continue -age_mtime = build.age_mtime() -host_count[tree]+=1 - -if status failed in status: -broken_count[tree]+=1 -if PANIC
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 1d36022 Kill a global. from 1a6118b Support overriding cache page on command line for web/build.py Put pages into a separate class. Several other fixes. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 1d3602271d3b5898b46b2c3890a98ac8d92559b6 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 14:08:19 2010 +0100 Kill a global. --- Summary of changes: web/build.py | 97 + 1 files changed, 49 insertions(+), 48 deletions(-) Changeset truncated at 500 lines: diff --git a/web/build.py b/web/build.py index f8d74d5..d933554 100755 --- a/web/build.py +++ b/web/build.py @@ -163,14 +163,12 @@ def format_subunit_reason(reason): return div class=\reason\%s/div % reason -def print_log_pretty(log): -# prints the log in a visually appealing manner -global indice -indice = 0 +class LogPrettyPrinter(object): + +def __init__(self): +self.indice = 0 -# do some pretty printing for the actions -def pretty_print(m): -global indice +def _pretty_print(self, m): output = m.group(1) actionName = m.group(2) status = m.group(3) @@ -178,37 +176,19 @@ def print_log_pretty(log): if actionName == 'cc_checker': output = print_log_cc_checker(output) -indice += 1 -return make_collapsible_html('action', actionName, output, indice, status) - -pattern = re.compile((Running action\s+([\w\-]+)$(?:\s^.*$)*?\sACTION\ (PASSED|FAILED):\ ([\w\-]+)$), re.M) -log = pattern.sub(pretty_print, log) +self.indice += 1 +return make_collapsible_html('action', actionName, output, self.indice, status) # log is already CGI-escaped, so handle '' in test name by handling gt -def format_stage(m): -indice += 1 -return make_collapsible_html('test', m.group(1), m.group(2), indice, m.group(3)) - -log = re.sub( - --==--==--==--==--==--==--==--==--==--==--.*? - Running\ test\ ([\w\-=,_:\ /.;]+).*? - --==--==--==--==--==--==--==--==--==--==-- - (.*?) - ==.*? - TEST\ (FAILED|PASSED|SKIPPED):.*? - ==\s+ -, format_stage, log) +def _format_stage(self, m): +self.indice += 1 +return make_collapsible_html('test', m.group(1), m.group(2), self.indice, m.group(3)) -def format_skip_testsuite(m): -global indice -indice += 1 -return make_collapsible_html('test', m.group(1), '', indice, 'skipped') +def _format_skip_testsuite(self, m): +self.indice += 1 +return make_collapsible_html('test', m.group(1), '', self.indice, 'skipped') -log = re.sub(skip-testsuite: ([\w\-=,_:\ /.; \(\)]+).*?, -format_skip_testsuite, log) - -def format_testsuite(m): -global indice +def _format_testsuite(self, m): testName = m.group(1) content = m.group(2) status = subunit_to_buildfarm_result(m.group(3)) @@ -216,23 +196,44 @@ def print_log_pretty(log): errorReason = format_subunit_reason(m.group(4)) else: errorReason = -indice += 1 -return make_collapsible_html('test', testName, content+errorReason, indice, status) - -pattern = re.compile(^testsuite: (.+)$\s((?:^.*$\s)*?)testsuite-(\w+): .*?(?:(\[$\s(?:^.*$\s)*?^\]$)|$), re.M) -log = pattern.sub(format_testsuite, log) +self.indice += 1 +return make_collapsible_html('test', testName, content+errorReason, self.indice, status) + +def _format_test(self, m): +self.indice += 1 +return make_collapsible_html('test', m.group(1), m.group(2)+format_subunit_reason(m.group(4)), self.indice, subunit_to_buildfarm_result(m.group(3))) + +def pretty_print(self, log): +# do some pretty printing for the actions +pattern = re.compile((Running action\s+([\w\-]+)$(?:\s^.*$)*?\sACTION\ (PASSED|FAILED):\ ([\w\-]+)$), re.M) +log = pattern.sub(self._pretty_print, log) + +log = re.sub( + --==--==--==--==--==--==--==--==--==--==--.*? + Running\ test\ ([\w\-=,_:\ /.;]+).*? + --==--==--==--==--==--==--==--==--==--==-- + (.*?) + ==.*? + TEST\ (FAILED|PASSED|SKIPPED):.*? + ==\s+ +, self._format_stage, log) + +log = re.sub(skip-testsuite: ([\w\-=,_:\ /.; \(\)]+).*?, +self._format_skip_testsuite, log) + +pattern = re.compile(^testsuite: (.+)$\s((?:^.*$\s)*?)testsuite-(\w+): .*?(?:(\[$\s
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 7fd815d fix git root. from 1d36022 Kill a global. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 7fd815d0a196ed363342b2aa77707b6863c825d7 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 14:21:40 2010 +0100 fix git root. --- Summary of changes: buildfarm/__init__.py |9 +++-- buildfarm/history.py | 16 2 files changed, 19 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index ba87fb1..76a4146 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -21,6 +21,8 @@ import ConfigParser import os import re +GIT_ROOT = /data/git + class Tree(object): A tree to build. @@ -35,8 +37,11 @@ class Tree(object): self.scm = scm def get_branch(self): -from buildfarm.history import GitBranch -return GitBranch(self.repo, self.branch) +if self.scm == git: +from buildfarm.history import GitBranch +return GitBranch(os.path.join(GIT_ROOT, self.repo), self.branch) +else: +raise NotImplementedError(self.scm) def __repr__(self): return %s %r % (self.__class__.__name__, self.name) diff --git a/buildfarm/history.py b/buildfarm/history.py index d52bec1..ffe392f 100644 --- a/buildfarm/history.py +++ b/buildfarm/history.py @@ -27,8 +27,11 @@ from dulwich.repo import Repo class Branch(object): +A version control branch. def authors(self): +Determine all authors that have contributed to this project. + ret = set() for rev in self.log(): ret.add(rev.author) @@ -43,7 +46,8 @@ class Branch(object): class Revision(object): -def __init__(self, revision, date, author, message, modified=[], added=[], removed=[]): +def __init__(self, revision, date, author, message, modified=[], added=[], +removed=[]): self.revision = revision self.date = date self.author = author @@ -78,7 +82,9 @@ class GitBranch(object): removed.add(oldpath) else: modified.add(newpath) -return Revision(commit.id, commit.commit_time, commit.author, commit.message, modified=modified, removed=removed, added=added) +return Revision(commit.id, commit.commit_time, commit.author, +commit.message, modified=modified, removed=removed, +added=added) def log(self, from_rev=None, exclude_revs=None): if from_rev is None: @@ -105,6 +111,8 @@ class GitBranch(object): def diff(self, revision): commit = self.repo[revision] f = StringIO() -for (oldpath, newpath), (oldmode, newmode), (oldsha, newsha) in self._changes_for(commit): -write_blob_diff(f, (oldpath, oldmode, self.store[oldsha]), (newpath, newmode, self.store[newsha])) +changes = self._changes_for(commit) +for (oldpath, newpath), (oldmode, newmode), (oldsha, newsha) in changes: +write_blob_diff(f, (oldpath, oldmode, self.store[oldsha]), +(newpath, newmode, self.store[newsha])) return (self._revision_from_commit(commit), f.getvalue()) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via c868b29 Allow limiting the number of revisions that we look back. from de84a30 Provide GitBranch.authors. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit c868b2951d467200f728c15049f5099cec5bc98d Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 14:36:29 2010 +0100 Allow limiting the number of revisions that we look back. --- Summary of changes: buildfarm/history.py |6 -- web/build.py |3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/history.py b/buildfarm/history.py index 1c96120..383782b 100644 --- a/buildfarm/history.py +++ b/buildfarm/history.py @@ -29,11 +29,13 @@ from dulwich.repo import Repo class Branch(object): A version control branch. -def authors(self): +def authors(self, limit=None): Determine all authors that have contributed to this project. ret = set() -for rev in self.log(): +for i, rev in enumerate(self.log()): +if i == limit: +break ret.add(rev.author) return ret diff --git a/web/build.py b/web/build.py index d933554..88e99aa 100755 --- a/web/build.py +++ b/web/build.py @@ -52,6 +52,7 @@ basedir = os.path.abspath(os.path.join(webdir, ..)) UNPACKED_BASE = http://svn.samba.org/ftp/unpacked; GITWEB_BASE = http://gitweb.samba.org; +HISTORY_HORIZON = 1000 # this is automatically filled in deadhosts = [] @@ -875,7 +876,7 @@ class RecentCheckinsPage(BuildFarmPage): def render(self, myself, tree, author=None): t = self.buildfarm.trees[tree] authors = set([ALL]) -authors.update(t.get_branch().authors(tree)) +authors.update(t.get_branch().authors(limit=HISTORY_HORIZON)) yield h2Recent checkins for %s (%s branch %s)/h2\n % ( tree, t.scm, t.branch) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 0ab262b attempt to speed up log parsing by compiling regexes beforehand. from c868b29 Allow limiting the number of revisions that we look back. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 0ab262b677046d51191a2598d040e09f0d59ff7b Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 14:40:18 2010 +0100 attempt to speed up log parsing by compiling regexes beforehand. --- Summary of changes: buildfarm/data.py | 32 1 files changed, 16 insertions(+), 16 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 8629842..0bd1498 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -109,30 +109,17 @@ def build_status_from_logs(log, err): ret = BuildStatus() stages = [] +re_status = re.compile(^([A-Z_]+) STATUS:(\s*\d+)$) +re_action = re.compile(^ACTION (PASSED|FAILED):\s+test$) for l in log: -m = re.match(^([A-Z_]+) STATUS:(\s*\d+)$, l) -if m: -stages.append(BuildStageResult(m.group(1), int(m.group(2).strip( -if m.group(1) == TEST: -test_seen = 1 -continue -m = re.match(^ACTION (PASSED|FAILED):\s+test$, l) -if m and not test_seen: -if m.group(1) == PASSED: -stages.append(BuildStageResult(TEST, 0)) -else: -stages.append(BuildStageResult(TEST, 1)) -continue - if l.startswith(No space left on device): ret.other_failures.add(disk full) continue if l.startswith(maximum runtime exceeded): ret.other_failures.add(timeout) continue -m = re.match(^(PANIC|INTERNAL ERROR):.*$, l) -if m: +if l.startswith(PANIC:) or l.startswith(INTERNAL ERROR:): ret.other_failures.add(panic) continue if l.startswith(testsuite-failure: ) or l.startswith(testsuite-error: ): @@ -141,6 +128,19 @@ def build_status_from_logs(log, err): if l.startswith(testsuite-success: ): test_successes += 1 continue +m = re_status.match(l) +if m: +stages.append(BuildStageResult(m.group(1), int(m.group(2).strip( +if m.group(1) == TEST: +test_seen = 1 +continue +m = re_action.match(l) +if m and not test_seen: +if m.group(1) == PASSED: +stages.append(BuildStageResult(TEST, 0)) +else: +stages.append(BuildStageResult(TEST, 1)) +continue # Scan err file for specific errors for l in err: -- build.samba.org
Re: [SCM] Samba Shared Repository - branch master updated
On Sat, 2010-11-13 at 11:50 +0100, Matthias Dieter Wallnöfer wrote: Well basically yes, ekacnet. But I don't see any problem to use modify_ldif/add_ldif when sending very special requests as password changes and others. Sometimes it's really needed due to encoding constraints. Can you give an example of this? E.g. in this situation below it would be simpler without the ldif. Since LDIFs are always converted to ldb Message anyway before they are processed I don't see how they could be used in a larger number of situations. Cheers, Jelmer u Patou wrote: Hi Mathias, We try to get rid of the modify_ldif way of doing ldb modification. It's better to create a ldb.Message() object and then do a ldb.modify() with it like this: --- a/source4/scripting/python/samba/upgradehelpers.py +++ b/source4/scripting/python/samba/upgradehelpers.py @@ -835,14 +835,13 @@ def update_machine_account_password(samdb, secrets_ldb, names): res = samdb.search(expression=expression, attrs=[]) assert(len(res) == 1) +msg = ldb.Message(res[0].dn) machinepass = samba.generate_random_password(128, 255) - -samdb.modify_ldif( -dn: + str(res[0].dn) + -changetype: modify -replace: clearTextPassword -clearTextPassword:: + base64.b64encode(machinepass.encode('utf-16-le')) + -) +mpu = machinepass.encode('utf-16-le') +msg[clearTextPassword] = ldb.MessageElement(mpu, +ldb.FLAG_MOD_REPLACE, +clearTextPassword) +samdb.modify(msg) res = samdb.search(expression=(samAccountName=%s$ % names.netbiosname), attrs=[msDs-keyVersionNumber]) Matthieu. On 11/11/2010 12:48, Matthias Dieter WallnXXfer wrote: The branch, master has been updated via bb241f5 s4:pytevent.c - fix a discard const warning via f036790 ldb:ldb_ldap.c rename operation - check for the RDN name and value via feb00fe s4:dsdb - proof against empty RDN values where expected via 4fe63d9 Cannot create OU using custom Schema class via e96c9df s4:objectclass LDB module - allow RDNs also to come from superclasses via 4f86f29 s4:passwords.py - add a test for the normal userPassword behaviour via 7f171a9 s4:password_hash and acl LDB modules - handle the userPassword attribute according to the dSHeuristics via d6c78fb s4:password_hash LDB module - move samdb_msg_find_old_and_new_ldb_val into the password_hash LDB module via eff1e8c s4:libnet/libnet_samsync_ldb.c - remove userPassword remove code via 39f8661 s4:local_password LDB module - remove schema checking code and fix some typos via ed704c2 s4:ldb_modules/util.c - dsHeuristics - dSHeuristics via 79548f0 s4:selftest/tests.py - skip the passwords.py suite on Windows 2000 domain function level via 5ded90e s4:acl.py - two password change tests are expected to fails on Windows 2000 function level via 2403aaa s4:upgradehelpers.py - use clearTextPassword rather than userPassword via 7c59ece s4:speedtest.py - use unicodePwd for setting user's password via 0e94569 s4:speedtest.py - remove duplicated code via 0a29e55 s4:speedtest.py - fix script name in the help text via ed1ca1c s4:speedtest.py - make it executable via cc7f390 s4:python tests - fix script names in the help text from ee50bdd s4-loadparm: fix the FLAG_DEFAULT settings on specially handled parameters http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit bb241f5cf8424c2576d5bc33ac149e5720b82068 Author: Matthias Dieter Wallnöferm...@samba.org Date: Wed Nov 10 16:21:41 2010 +0100 s4:pytevent.c - fix a discard const warning Autobuild-User: Matthias Dieter Wallnöferm...@samba.org Autobuild-Date: Thu Nov 11 09:47:55 UTC 2010 on sn-devel-104 commit f0367905d9a6db76712f1dcf9734f64fe5c5e1b3 Author: Matthias Dieter Wallnöferm...@samba.org Date: Wed Nov 10 16:20:38 2010 +0100 ldb:ldb_ldap.c rename operation - check for the RDN name and value Make it more similar to ldb_ildap.c and also more save commit feb00fe7cc238a78b3832c116cb4634936597735 Author: Matthias Dieter Wallnöferm...@samba.org Date: Wed Nov 10 16:05:16 2010 +0100 s4:dsdb - proof against empty RDN values where expected This should prevent crashes as pointed out on the mailing list. commit 4fe63d927e5e684d3e2bec9642a1e77b056ab2ed Author: Zahari Zaharievzahari.zahar...@postpath.com Date: Tue Nov 9 14:55:32 2010 +0200 Cannot create OU using custom Schema class If we define our own child class
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 758927a Fix cache. from be38b55 Limit history. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 758927a28262520944ed6f16029ebe993c8f1498 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 15:11:10 2010 +0100 Fix cache. --- Summary of changes: buildfarm/filecache.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/filecache.py b/buildfarm/filecache.py index 52e0183..d9c4a16 100644 --- a/buildfarm/filecache.py +++ b/buildfarm/filecache.py @@ -24,6 +24,8 @@ from buildfarm import ( from buildfarm.data import ( Build, BuildResultStore, +BuildStageResult, +BuildStatus, NoSuchBuildError, UploadBuildResultStore, check_dir_exists, -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 4295e5e Fix CSS in standalone mode, move static file hack out of app, get rid of global. from c24daf3 Remove obsolete tree, more history horizon. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 4295e5e2b719ac3eb73402f696ce842cefb2a253 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 16:06:49 2010 +0100 Fix CSS in standalone mode, move static file hack out of app, get rid of global. --- Summary of changes: web/build.py | 49 ++--- 1 files changed, 26 insertions(+), 23 deletions(-) Changeset truncated at 500 lines: diff --git a/web/build.py b/web/build.py index 38949af..a8e96a7 100755 --- a/web/build.py +++ b/web/build.py @@ -47,7 +47,6 @@ import re import time import wsgiref.util -standalone = 0 webdir = os.path.dirname(__file__) basedir = os.path.abspath(os.path.join(webdir, ..)) @@ -944,22 +943,6 @@ class BuildFarmApp(object): fn_name = get_param(form, 'function') or '' myself = wsgiref.util.application_uri(environ) -if standalone and environ['PATH_INFO']: -dir = os.path.join(os.path.dirname(__file__)) -if re.match(^/[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)?, environ['PATH_INFO']): -static_file = %s/%s % (dir, environ['PATH_INFO']) -if os.path.exists(static_file): -tab = environ['PATH_INFO'].split('.') -if len(tab) 1: -extension = tab[-1] -import mimetypes -mimetypes.init() -type = mimetypes.types_map[.%s % extension] -start_response('200 OK', [('Content-type', type)]) -data = open(static_file, 'rb').read() -yield data -return - if fn_name == 'text_diff': start_response('200 OK', [('Content-type', 'application/x-diff')]) tree = get_param(form, 'tree') @@ -982,10 +965,7 @@ class BuildFarmApp(object): yield meta name='description' contents='Home of the Samba Build Farm, the automated testing facility.'/ yield meta name='robots' contents='noindex'/ yield link rel='stylesheet' href='/build_farm.css' type='text/css' media='all'/ -if standalone: -yield link rel='stylesheet' href='common.css' type='text/css' media='all'/ -else: -yield link rel='stylesheet' href='http://master.samba.org/samba/style/common.css' type='text/css' media='all'/ +yield link rel='stylesheet' href='http://master.samba.org/samba/style/common.css' type='text/css' media='all'/ yield link rel='shortcut icon' href='http://www.samba.org/samba/images/favicon.ico'/ yield /head yield body @@ -1038,13 +1018,36 @@ if __name__ == '__main__': parser = optparse.OptionParser([options]) parser.add_option(--standalone, help=Run as standalone server (useful for debugging), action=store_true) parser.add_option(--cachedirname, help=Cache directory name, type=str) +parser.add_option(--port, help=Port to listen on (in standalone mode) [localhost:8000], default=localhost:8000, type=str) opts, args = parser.parse_args() buildfarm = CachingBuildFarm(cachedirname=opts.cachedirname) buildApp = BuildFarmApp(buildfarm) if opts.standalone: -standalone = 1 from wsgiref.simple_server import make_server -httpd = make_server('localhost', 8000, buildApp) + +def standaloneApp(environ, start_response): +if environ['PATH_INFO']: +dir = os.path.join(os.path.dirname(__file__)) +if re.match(^/[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)?, environ['PATH_INFO']): +static_file = %s/%s % (dir, environ['PATH_INFO']) +if os.path.exists(static_file): +tab = environ['PATH_INFO'].split('.') +if len(tab) 1: +extension = tab[-1] +import mimetypes +mimetypes.init() +type = mimetypes.types_map[.%s % extension] +start_response('200 OK', [('Content-type', type)]) +data = open(static_file, 'rb').read() +yield data +return +yield .join(buildApp(environ, start_response)) +try: +(address, port) = opts.port.rsplit(:, 1) +except ValueError: +address = localhost +port = opts.port +httpd = make_server
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 32b2b08 Mention correct port in message. from 4295e5e Fix CSS in standalone mode, move static file hack out of app, get rid of global. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 32b2b08294b9c2e98828d98df30ae77eab25ac92 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 16:08:34 2010 +0100 Mention correct port in message. --- Summary of changes: buildfarm/data.py |3 --- web/build.py |2 +- 2 files changed, 1 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 4120730..d6d5732 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -376,6 +376,3 @@ class BuildResultStore(object): def get_latest_revision(self, tree, host, compiler): raise NoSuchBuildError(tree, host, compiler) - - - diff --git a/web/build.py b/web/build.py index a8e96a7..227512a 100755 --- a/web/build.py +++ b/web/build.py @@ -1048,7 +1048,7 @@ if __name__ == '__main__': address = localhost port = opts.port httpd = make_server(address, int(port), standaloneApp) -print Serving on port 8000... +print Serving on %s:%d... % (address, int(port)) httpd.serve_forever() else: import wsgiref.handlers -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 398247a Improve regressed_since. from 7176a9c Fix old revisions table. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 398247a96c40d927d0f0b81ee8a816f2ff16d5a7 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 16:48:01 2010 +0100 Improve regressed_since. --- Summary of changes: buildfarm/data.py |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index d6d5732..47a76b4 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -71,6 +71,12 @@ class BuildStatus(object): Check if this build has regressed since another build. if disk full in self.other_failures: return False +if timeout in self.other_failures and timeout in other.other_failures: +# When the timeout happens exactly can differ slightly, so it's okay +# if the numbers are a bit different.. +return False +if panic in self.other_failures and not panic in other.other_failures: +return True return cmp(self._status_tuple(), other._status_tuple()) def __cmp__(self, other): -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 73d45eb Cope with system version of sqlite. from 731e40e Fix commit handling from specific author. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 73d45eb068a9cbed4712e3e7742f09c9707746aa Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 17:26:31 2010 +0100 Cope with system version of sqlite. --- Summary of changes: buildfarm/sqldb.py |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index d1ca87d..ca7d235 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -33,7 +33,10 @@ from buildfarm.hostdb import ( ) import os -import pysqlite2 +try: +import sqlite3 +except ImportError: +from pysqlite2 import dbapi2 as sqlite3 from storm.database import create_database from storm.locals import Bool, Desc, Int, Unicode, RawStr from storm.store import Store @@ -100,7 +103,7 @@ class StormHostDatabase(HostDatabase): try: self.store.add(newhost) self.store.flush() -except pysqlite2.dbapi2.IntegrityError: +except sqlite3.IntegrityError: raise HostAlreadyExists(name) return newhost -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via d5fc97f Don't kill upload builds just yet, improve verboseness. from 9ff770d Cope with previous builds disappearing. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit d5fc97f2d69f206b0db768b9d0f094d92af76806 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 18:08:33 2010 +0100 Don't kill upload builds just yet, improve verboseness. --- Summary of changes: buildfarm/data.py |1 + buildfarm/sqldb.py|8 import-and-analyse.py |9 + 3 files changed, 10 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 47a76b4..bc0eac9 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -376,6 +376,7 @@ class BuildResultStore(object): os.link(build.basename+.log, new_basename+.log) if os.path.exists(build.basename+.err): os.link(build.basename+.err, new_basename+.err) +return Build(new_basename, build.tree, build.host, build.compiler, rev) def get_previous_revision(self, tree, host, compiler, revision): raise NoSuchBuildError(tree, host, compiler, revision) diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index a244bd9..5ab71df 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -170,8 +170,6 @@ class StormCachingBuildResultStore(BuildResultStore): return build.revision def upload_build(self, build): -super(StormCachingBuildResultStore, self).upload_build(build) -rev, timestamp = build.revision_details() result = self.store.find(StormBuild, StormBuild.checksum == build.log_checksum()) existing_build = result.one() if existing_build is not None: @@ -179,14 +177,16 @@ class StormCachingBuildResultStore(BuildResultStore): assert build.tree == existing_build.tree assert build.host == existing_build.host assert build.compiler == existing_build.compiler -assert rev == existing_build.revision -return +return existing_build +rev, timestamp = build.revision_details() +super(StormCachingBuildResultStore, self).upload_build(build) new_basename = self.build_fname(build.tree, build.host, build.compiler, rev) new_build = StormBuild(new_basename, unicode(build.tree), unicode(build.host), unicode(build.compiler), rev) new_build.checksum = build.log_checksum() new_build.age = build.age_mtime() new_build.status = unicode(str(build.status())) self.store.add(new_build) +return new_build class StormCachingBuildFarm(BuildFarm): diff --git a/import-and-analyse.py b/import-and-analyse.py index 4f99b5c..a1cb47f 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -38,7 +38,7 @@ def check_and_send_mails(tree, host, compiler, cur, old): old_status = old.status() if not cur_status.regressed_since(old_status): -if opts.verbose = 1: +if opts.verbose = 3: print ... hasn't regressed since %s: %s % (old_rev, old_status) return @@ -83,7 +83,7 @@ The build may have been broken by one of the following commits: for build in buildfarm.get_new_builds(): -if opts.verbose = 1: +if opts.verbose = 2: print Processing %s... % build, if not opts.dry_run: @@ -91,7 +91,7 @@ for build in buildfarm.get_new_builds(): (rev, rev_timestamp) = build.revision_details() -if opts.verbose = 1: +if opts.verbose = 2: print str(build.status()) try: @@ -114,7 +114,8 @@ for build in buildfarm.get_new_builds(): check_and_send_mails(build.tree, build.host, build.compiler, build, prev_build) if not opts.dry_run: -build.remove() +# When the new web script is introduced, kill the build here: +# build.remove() buildfarm.commit() smtp.quit() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 2ec5988 Cope with missing revision info in logs. from 926046e Fix override of status method. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 2ec59886e606ae73e0c9305450a9e1c148b7b41e Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 18:30:56 2010 +0100 Cope with missing revision info in logs. --- Summary of changes: buildfarm/data.py | 13 ++--- buildfarm/sqldb.py|2 +- import-and-analyse.py | 12 ++-- 3 files changed, 21 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 10966f4..5c25aab 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -42,6 +42,13 @@ class BuildSummary(object): BuildStageResult = collections.namedtuple(BuildStageResult, name result) +class MissingRevisionInfo(Exception): +Revision info could not be found in the build log. + +def __init__(self, build): +self.build = build + + class BuildStatus(object): def __init__(self, stages=None, other_failures=None): @@ -259,6 +266,9 @@ class Build(object): finally: f.close() +if revid is None: +raise MissingRevisionInfo(self) + return (revid, timestamp) def status(self): @@ -375,9 +385,6 @@ class BuildResultStore(object): def upload_build(self, build): (rev, rev_timestamp) = build.revision_details() -if not rev: -raise Exception(Unable to find revision in %r log % build) - new_basename = self.build_fname(build.tree, build.host, build.compiler, rev) try: existing_build = self.get_build(build.tree, build.host, build.compiler, rev) diff --git a/buildfarm/sqldb.py b/buildfarm/sqldb.py index 2f65931..709784f 100644 --- a/buildfarm/sqldb.py +++ b/buildfarm/sqldb.py @@ -192,7 +192,7 @@ class StormCachingBuildResultStore(BuildResultStore): new_build = StormBuild(new_basename, unicode(build.tree), unicode(build.host), unicode(build.compiler), rev) new_build.checksum = build.log_checksum() new_build.age = build.age_mtime() -new_build.status = unicode(str(build.status())) +new_build.status_str = unicode(str(build.status())) self.store.add(new_build) return new_build diff --git a/import-and-analyse.py b/import-and-analyse.py index dcfcec6..773a03f 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -90,9 +90,17 @@ for build in buildfarm.get_new_builds(): continue if not opts.dry_run: -build = buildfarm.builds.upload_build(build) +try: +build = buildfarm.builds.upload_build(build) +except data.MissingRevisionInfo: +print No revision info in %r, skipping % build +continue -(rev, rev_timestamp) = build.revision_details() +try: +(rev, rev_timestamp) = build.revision_details() +except data.MissingRevisionInfo: +print No revision info in %r, skipping % build +continue if opts.verbose = 2: print str(build.status()) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 7f9ad8f Fix formatting. from 2ec5988 Cope with missing revision info in logs. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 7f9ad8f7fd4ba40d144db6e1215b4bb36f8e2a1f Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 19:31:50 2010 +0100 Fix formatting. --- Summary of changes: import-and-analyse.py |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/import-and-analyse.py b/import-and-analyse.py index 773a03f..ec61fba 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -83,9 +83,6 @@ The build may have been broken by one of the following commits: for build in buildfarm.get_new_builds(): -if opts.verbose = 2: -print Processing %s... % build, - if build in buildfarm.builds: continue @@ -103,6 +100,7 @@ for build in buildfarm.get_new_builds(): continue if opts.verbose = 2: +print %s... % build, print str(build.status()) try: -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via c3b0245 Try a bit harder to not fetch from the upload directory when looking for old builds. from 7f9ad8f Fix formatting. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit c3b0245cc29002085ff3c1e8cdcd6a565ebb5bb9 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 19:42:52 2010 +0100 Try a bit harder to not fetch from the upload directory when looking for old builds. --- Summary of changes: buildfarm/__init__.py |2 +- import-and-analyse.py |4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 58b66fb..8d593c4 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -130,7 +130,7 @@ class BuildFarm(object): return perc def get_build(self, tree, host, compiler, rev=None): -if rev: +if rev is not None: return self.builds.get_build(tree, host, compiler, rev) else: return self.upload_builds.get_build(tree, host, compiler) diff --git a/import-and-analyse.py b/import-and-analyse.py index ec61fba..ed854ec 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -115,11 +115,13 @@ for build in buildfarm.get_new_builds(): # Can't send a nastygram until there are 2 builds.. else: try: -prev_build = buildfarm.get_build(build.tree, build.host, build.compiler, prev_rev) +assert prev_rev is not None +prev_build = buildfarm.builds.get_build(build.tree, build.host, build.compiler, prev_rev) except data.NoSuchBuildError: if opts.verbose = 1: print Previous build %s has disappeared % prev_build else: +assert build.log_checksum() != prev_build.log_checksum() check_and_send_mails(build.tree, build.host, build.compiler, build, prev_build) if not opts.dry_run: -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 52a2144 Remove now obsolete hostdb.pm. via 6cccf14 Switch over to using python import-and-analyse. via 90150b8 Fix blame mail sending. from c3b0245 Try a bit harder to not fetch from the upload directory when looking for old builds. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 52a21444c38370270d31dd604934e56727aa8128 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 20:00:40 2010 +0100 Remove now obsolete hostdb.pm. commit 6cccf1436f7a41a8f63051bccade9f4a2ab309ee Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 19:57:47 2010 +0100 Switch over to using python import-and-analyse. commit 90150b8b7b08904b4ec880822f3208a34c2467ec Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 19:56:28 2010 +0100 Fix blame mail sending. --- Summary of changes: build.pm |9 - hostdb.pm | 236 import-and-analyse.pl | 407 - import-and-analyse.py |5 +- revs.sh |2 +- tests/hostdb.pl | 74 - web/trees.conf|2 +- 7 files changed, 4 insertions(+), 731 deletions(-) delete mode 100644 build.pm delete mode 100644 hostdb.pm delete mode 100755 import-and-analyse.pl delete mode 100755 tests/hostdb.pl Changeset truncated at 500 lines: diff --git a/build.pm b/build.pm deleted file mode 100644 index 7de9cc7..000 --- a/build.pm +++ /dev/null @@ -1,9 +0,0 @@ -package BuildFarm; - -use strict; - -use vars qw ( $VERSION ); - -$VERSION = '0.01'; - -1; diff --git a/hostdb.pm b/hostdb.pm deleted file mode 100644 index 372483d..000 --- a/hostdb.pm +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/perl - -# Samba.org buildfarm -# Copyright (C) 2008 Andrew Bartlett abart...@samba.org -# Copyright (C) 2008 Jelmer Vernooij jel...@samba.org -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# - -package hostdb; - -use DBI; -use warnings; -use strict; - -sub new($) - { -my ($class, $filename) = @_; - -my $dbh = DBI-connect(dbi:SQLite:$filename, , , {RaiseError = 1, PrintError = 0, -ShowErrorStatement = 1, AutoCommit = 0}) or return undef; - -my $self = { filename = $filename, dbh = $dbh }; - -bless($self, $class); -} - -sub provision($) -{ - my ($self) = @_; - eval { - $self-{dbh}-do(CREATE TABLE host ( name text, owner text, owner_email text, password text, ssh_access int, fqdn text, platform text, permission text, last_dead_mail int, join_time int );); - - $self-{dbh}-do(CREATE UNIQUE INDEX unique_hostname ON host (name);); - - $self-{dbh}-do(CREATE TABLE build ( id integer primary key autoincrement, tree text, revision text, host text, compiler text, checksum text, age int, status text, commit_revision text);); - $self-{dbh}-do(CREATE UNIQUE INDEX unique_checksum ON build (checksum);); - - $self-{dbh}-do(CREATE TABLE test_run ( build int, test text, result text, output text);); - $self-{dbh}-commit(); - }; - if ($@) { - local $self-{dbh}-{RaiseError} = 0; - $self-{dbh}-rollback(); - print DB Failure: $@; - return 0; - } - return 1; -} - -sub createhost($$) -{ - my ($self, $name, $platform, $owner, $owner_email, $password, $permission) = @_; - my $sth = $self-{dbh}-prepare(INSERT INTO host (name, platform, owner, owner_email, password, permission, join_time) VALUES (?,?,?,?,?,?,?)); - - eval { - $sth-execute($name, $platform, $owner, $owner_email, $password, $permission, time()); - $self-{dbh}-commit(); - }; - if ($@) { - local $self-{dbh}-{RaiseError} = 0; - $self-{dbh}-rollback(); - print DB Failure: $@; - return 0; - } - return 1; -} - -sub deletehost($$) -{ - my ($self, $name) = @_; - my $ret; - my $sth = $self-{dbh}-prepare(DELETE FROM host WHERE name = ?); - - eval { - $ret = $sth-execute($name); - $self-{dbh
[SCM] build.samba.org - branch master updated
The branch, master has been updated via cfdeca5 Properly encode dictionary elements. from 52a2144 Remove now obsolete hostdb.pm. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit cfdeca50120dceb9f0bb3e5d161a185c93159def Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 20:09:11 2010 +0100 Properly encode dictionary elements. --- Summary of changes: buildfarm/tests/test_data.py |5 - import-and-analyse.py| 14 -- 2 files changed, 16 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 5c233c2..e79224b 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -97,7 +97,10 @@ bla BUILD COMMIT TIME: 3 August 2010 ) build = self.x.get_build(tdb, charis, cc, 12) -self.assertEquals((43, 3 August 2010), build.revision_details()) +(rev, timestamp) = build.revision_details() +self.assertIsInstance(rev, str) +self.assertIsInstance(timestamp, str) +self.assertEquals((43, 3 August 2010), (rev, timestamp)) def test_revision_details_no_timestamp(self): self.create_mock_logfile(tdb, charis, cc, rev=12, contents= diff --git a/import-and-analyse.py b/import-and-analyse.py index 8ce42b2..3891f1e 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -69,8 +69,18 @@ See http://build.samba.org/?function=View+Build;host=%(host)s;tree=%(tree)s;comp The build may have been broken by one of the following commits: %(change_log)s - % {tree: tree, host: host, compiler: compiler, change_log: change_log, scm: t.scm, branch: t.branch, -cur_rev: cur_rev, old_rev: old_rev, cur_status: cur_status, old_status: old_status } + % { +tree: tree.encode(utf-8), +host: host.encode(utf-8), +compiler: compiler.encode(utf-8), +change_log: change_log, +scm: t.scm, +branch: t.branch, +cur_rev: cur_rev, +old_rev: old_rev, +cur_status: cur_status, +old_status: old_status, +} msg = MIMEText(body) msg[Subject] = BUILD of %s:%s BROKEN on %s with %s AT REVISION %s % (tree, t.branch, host, compiler, cur_rev) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 4bfd615 Fix nasty gram sending. from cfdeca5 Properly encode dictionary elements. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 4bfd6157b74a824ed22549cf1f22be31ca6f5243 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 20:11:15 2010 +0100 Fix nasty gram sending. --- Summary of changes: import-and-analyse.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/import-and-analyse.py b/import-and-analyse.py index 3891f1e..d88ef43 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -87,7 +87,7 @@ The build may have been broken by one of the following commits: msg[From] = \Build Farm\ bu...@samba.org msg[To] = ,.join(recipients) if not opts.dry_run: -smtp.send(msg[From], [msg[To]], msg.as_string()) +smtp.sendmail(msg[From], [msg[To]], msg.as_string()) else: print msg.as_string() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via c155466 Remove some unncessary indirects. via cceb98b Implement diff. via 95015a7 Simplify history walking. via 10c6a03 work on history support using dulwich from c1e3f3d print the return code value as it can help debug http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit c1554666b2da05a03aeca52a4c4ab0498a2c9e90 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 10:17:37 2010 +0100 Remove some unncessary indirects. commit cceb98be07ee509d8560dfb4e3a16796514aa584 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 09:56:41 2010 +0100 Implement diff. commit 95015a7c09f04af4b7a717cf8277db960f32b7b8 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 09:45:33 2010 +0100 Simplify history walking. commit 10c6a0392671f0c4022c4b4decc2399c1d4a2e33 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 02:50:29 2010 +0100 work on history support using dulwich --- Summary of changes: buildfarm/__init__.py |4 + buildfarm/history.py| 143 +-- buildfarm/tests/test_history.py | 32 - import-and-analyse.py | 90 + web/build.py| 113 ++- 5 files changed, 180 insertions(+), 202 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 3bbfe4f..d866db4 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -34,6 +34,10 @@ class Tree(object): self.srcdir = srcdir self.scm = scm +def get_branch(self): +from buildfarm.history import GitBranch +return GitBranch(self.repo, self.branch) + def __repr__(self): return %s %r % (self.__class__.__name__, self.name) diff --git a/buildfarm/history.py b/buildfarm/history.py index 6ca1af8..537ce48 100644 --- a/buildfarm/history.py +++ b/buildfarm/history.py @@ -19,81 +19,92 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +from cStringIO import StringIO -from buildfarm import util +from dulwich.objects import Tree +from dulwich.patch import write_blob_diff +from dulwich.repo import Repo -import commands -import os -BASEDIR = /home/build/master -HISTORYDIR = /home/build/master/cache -TIMEZONE = PST -TIMEOFFSET = 0 -UNPACKED_DIR = /home/ftp/pub/unpacked +class Branch(object): -class History(object): +def authors(self): +ret = set() +for rev in self.log(): +ret.add(rev.author) +return ret -def __init__(self, db): -self.db = db +def log(self): +raise NotImplementedError(self.log) -def _log(self, tree): -return util.LoadStructure(os.path.join(HISTORYDIR, history.%s % tree)) +def diff(self, revision): +raise NotImplementedError(self.diff) -def diff(self, author, date, tree, revision): -get recent git entries -# validate the tree -t = self.db.trees[tree] -if t.scm == git: -self._git_diff(t, revision, tree) -else: -raise Exception(Unknown VCS %s % t.scm) +class Revision(object): + +def __init__(self, revision, date, author, message, modified=[], added=[], removed=[]): +self.revision = revision +self.date = date +self.author = author +self.message = message +self.modified = modified +self.added = added +self.removed = removed -def _git_diff(self, t, revision, tree): -show recent git entries -log = self._log(tree) +class GitBranch(object): -# backwards? why? well, usually our users are looking for the newest -# stuff, so it's most likely to be found sooner -for i in range(len(log), 0, -1): -if log[i][REVISION] == revision: -entry = log[i] -break +def __init__(self, path, branch=master): +self.repo = Repo(path) +self.store = self.repo.object_store +self.branch = branch + +def _changes_for(self, commit): +if len(commit.parents) == 0: +parent_tree = Tree().id +else: +parent_tree = self.store[commit.parents[0]].tree +return self.store.tree_changes(parent_tree, commit.tree) + +def _revision_from_commit(self, commit): +added = set() +modified = set() +removed = set() +for ((oldpath, newpath), (oldmode, newmode), (oldsha, newsha)) in self._changes_for(commit): +if oldpath is None: +added.add(newpath) +elif newpath is None: +removed.add(oldpath) +else
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 36bdf3c Support removing builds. from c155466 Remove some unncessary indirects. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 36bdf3c446ad9100ef78e6a62449b4e339176458 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 11:20:15 2010 +0100 Support removing builds. --- Summary of changes: buildfarm/data.py|5 + buildfarm/tests/test_data.py |7 +++ import-and-analyse.py|1 + 3 files changed, 13 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 26f2775..9f982db 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -177,6 +177,11 @@ class Build(object): self.compiler = compiler self.rev = rev +def remove(self): +os.unlink(self.basename + .log) +if os.path.exists(self.basename+.err): +os.unlink(self.basename+.err) + ### # the mtime age is used to determine if builds are still happening # on a host. diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 0559f8e..43451da 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -40,6 +40,13 @@ class BuildResultStoreTestBase(object): self.x.build_fname(mytree, myhost, cc, 123), %s/data/oldrevs/build.mytree.myhost.cc-123 % self.path) +def test_build_remove(self): +path = self.create_mock_logfile(tdb, charis, cc, 12) +build = self.x.get_build(tdb, charis, cc, 12) +build.remove() +self.assertFalse(os.path.exists(path)) +self.assertRaises(data.NoSuchBuildError, self.x.get_build, tdb, charis, cc, 12) + def test_build_age_mtime(self): path = self.create_mock_logfile(tdb, charis, cc, 12) # Set mtime to something in the past diff --git a/import-and-analyse.py b/import-and-analyse.py index 3a77f77..c468a82 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -103,5 +103,6 @@ for build in buildfarm.get_new_builds(): prev_build = buildfarm.get_build(build.tree, build.host, build.compiler, prev_rev) check_and_send_mails(build.tree, build.host, build.compiler, build, prev_build) +build.remove() smtp.quit() -- build.samba.org
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 5cf904b s4-waf: Only enable various wrappers if they're actually used. via b6e1362 Lowercase DNS_UPDATE_SRV name. from dedd064 tdb: set tdb-name early, as it's needed for tdb_name() http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 5cf904b1d9b4eaa366851d9ab51c0ed4e86d773e Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 12:55:14 2010 +0100 s4-waf: Only enable various wrappers if they're actually used. Autobuild-User: Jelmer Vernooij jel...@samba.org Autobuild-Date: Fri Nov 12 14:33:34 UTC 2010 on sn-devel-104 commit b6e13627dfca1171cf42e27e415c1fdb325d4926 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 12:17:45 2010 +0100 Lowercase DNS_UPDATE_SRV name. --- Summary of changes: lib/nss_wrapper/wscript_build|3 ++- lib/socket_wrapper/wscript_build |1 + lib/uid_wrapper/wscript_build|3 ++- source4/dsdb/wscript_build |2 +- 4 files changed, 6 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/wscript_build b/lib/nss_wrapper/wscript_build index 8004573..5f9df3a 100644 --- a/lib/nss_wrapper/wscript_build +++ b/lib/nss_wrapper/wscript_build @@ -4,6 +4,7 @@ bld.SAMBA_LIBRARY('nss_wrapper', source='nss_wrapper.c', deps='replace', - private_library=True + private_library=True, + enabled=bld.CONFIG_SET(NSS_WRAPPER), ) diff --git a/lib/socket_wrapper/wscript_build b/lib/socket_wrapper/wscript_build index e100ccc..a81c7aa 100644 --- a/lib/socket_wrapper/wscript_build +++ b/lib/socket_wrapper/wscript_build @@ -4,5 +4,6 @@ bld.SAMBA_LIBRARY('socket_wrapper', source='socket_wrapper.c', group='base_libraries', private_library=True, + enabled=bld.CONFIG_SET('SOCKET_WRAPPER'), deps='replace') diff --git a/lib/uid_wrapper/wscript_build b/lib/uid_wrapper/wscript_build index 2cb9868..54e5b80 100644 --- a/lib/uid_wrapper/wscript_build +++ b/lib/uid_wrapper/wscript_build @@ -4,6 +4,7 @@ bld.SAMBA_LIBRARY('uid_wrapper', source='uid_wrapper.c', deps='talloc', - private_library=True + private_library=True, + enabled=bld.CONFIG_SET(UID_WRAPPER), ) diff --git a/source4/dsdb/wscript_build b/source4/dsdb/wscript_build index 573b361..199555b 100644 --- a/source4/dsdb/wscript_build +++ b/source4/dsdb/wscript_build @@ -44,7 +44,7 @@ bld.SAMBA_MODULE('KCC_SRV', ) -bld.SAMBA_MODULE('DNS_UPDATE_SRV', +bld.SAMBA_MODULE('dns_update_srv', source='dns/dns_update.c', subsystem='service', init_function='server_service_dnsupdate_init', -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e4eba98 waf/samba_version: Simplify git show command. via 8d07e6d samba_version: Make COMMIT_IS_CLEAN an int rather than a string. via 7d961dd samba_version: Simplify dirty tree detection. via c338ded waf/samba_version: Support integer defines. via ed22f13 s3: Rename GIT_COMMIT_{TIME,DATE} to COMMIT_{TIME,DATE}. via 9ebb55d s4: Remove obsolete mkversion.sh via 7b964c7 samba_version: When working from git checkout, display git revision SHA1 rather than Bazaar revision ids. via a0c2040 samba_version: Support retrieving snapshot identity from bzr. via 45af495 samba_version: Cope with building snapshots in directories without git checkout. via d9a0a18 Put git tree finding into a separate function. via 80e2adc sambaversion.py: Some cleanups, make less git-specific. via e3b7ce8 wafsamba: Support make dist from bzr checkout. via 5a482a6 torture: Only add in tests for socket_wrapper/nss_wrapper when they have been enabled. via 7e8ea2c unix_privs: Add missing dependency on libreplace. via 1f853ee socket_wrapper: Only add as global dependency when enabled. via 32889f8 heimdal_build: Add missing dependency on replace, necessary because replace.h is included. from 5cf904b s4-waf: Only enable various wrappers if they're actually used. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e4eba98f831b869bf3894c2940a8131a7a6862be Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 18:27:46 2010 +0100 waf/samba_version: Simplify git show command. Autobuild-User: Jelmer Vernooij jel...@samba.org Autobuild-Date: Fri Nov 12 18:38:21 UTC 2010 on sn-devel-104 commit 8d07e6d986322c4954a385b9bfea73f0931b3053 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 18:20:02 2010 +0100 samba_version: Make COMMIT_IS_CLEAN an int rather than a string. commit 7d961ddc443a31d71cd3d2c02a397128da9be120 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 18:19:00 2010 +0100 samba_version: Simplify dirty tree detection. commit c338dede1b5bdab240a237581644158ba56249b3 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 18:06:43 2010 +0100 waf/samba_version: Support integer defines. commit ed22f13e7ead1b1ed2fd9dde51a479b9cfaf67aa Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 18:06:20 2010 +0100 s3: Rename GIT_COMMIT_{TIME,DATE} to COMMIT_{TIME,DATE}. This avoids some special casing in the waf code. commit 9ebb55d1cb1280a5b8a4d82ec35568c034898e41 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:59:07 2010 +0100 s4: Remove obsolete mkversion.sh commit 7b964c72698054337e1c40df23550edad96de8b5 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:54:41 2010 +0100 samba_version: When working from git checkout, display git revision SHA1 rather than Bazaar revision ids. commit a0c2040ab698c8f053d12b4f53b0ac76a8f5ebac Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:26:06 2010 +0100 samba_version: Support retrieving snapshot identity from bzr. commit 45af495695a83636e79a810e212542d7c292a9ac Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:18:30 2010 +0100 samba_version: Cope with building snapshots in directories without git checkout. Error out when run in a git checkout in which git fails. commit d9a0a18ddabe9b91e73cc8bf1582af46d208ff27 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:13:37 2010 +0100 Put git tree finding into a separate function. commit 80e2adc9c3412ac7d22ef9ebb0c8451768841b08 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:08:09 2010 +0100 sambaversion.py: Some cleanups, make less git-specific. commit e3b7ce85e2db8cf09202fc2da843cf043e64e81c Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 17:00:42 2010 +0100 wafsamba: Support make dist from bzr checkout. commit 5a482a641e9631e269684d4394864659791b5dec Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 16:23:03 2010 +0100 torture: Only add in tests for socket_wrapper/nss_wrapper when they have been enabled. commit 7e8ea2ca34462669810f540f7b09cd7475a87a7c Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 16:22:43 2010 +0100 unix_privs: Add missing dependency on libreplace. commit 1f853ee51b46b5a1a3b4e8e2c13023ddcc034fa2 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 16:22:16 2010 +0100 socket_wrapper: Only add as global dependency when enabled. commit 32889f83465a5e943beb47c059572b8cd108df9c Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 16:12:14 2010 +0100 heimdal_build: Add missing dependency on replace, necessary because replace.h is included
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 6b5ee74 Honor dry_run in import-and-analyse. via 0f899bb Simplify a bit. via dd74e7b Add command line parsing to mail-dead-hosts. from 36bdf3c Support removing builds. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 6b5ee746808f98bffcdf8287a02af6c6673eb9e8 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 19:55:06 2010 +0100 Honor dry_run in import-and-analyse. commit 0f899bb785925d073e4e6f8343b4ef5727fff042 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 19:53:20 2010 +0100 Simplify a bit. commit dd74e7b3633093ca3e0d723ca9e53e28c83308f5 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 19:53:12 2010 +0100 Add command line parsing to mail-dead-hosts. --- Summary of changes: buildfarm/__init__.py |2 +- import-and-analyse.py | 17 - mail-dead-hosts.py| 10 +++--- 3 files changed, 16 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index d866db4..06b2d31 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -50,7 +50,7 @@ def read_trees_from_conf(path): ret = {} cfp = ConfigParser.ConfigParser() -cfp.readfp(open(path)) +cfp.read(path) for s in cfp.sections(): ret[s] = Tree(name=s, **dict(cfp.items(s))) return ret diff --git a/import-and-analyse.py b/import-and-analyse.py index c468a82..f1b90f5 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -40,12 +40,8 @@ def check_and_send_mails(tree, host, compiler, cur, old): (old_rev, old_rev_timestamp) = old.revision_details() old_status = old.status() -if opts.dry_run: -print rev=%s status=%s % (cur_rev, cur_status) -print old rev=%s status=%s % (old_rev, old_status) - if not cur_status.regressed_since(old_status): -if opts.dry_run: +if opts.verbose: print the build didn't get worse since %r % old_status return @@ -83,14 +79,16 @@ The build may have been broken by one of the following commits: msg[Subject] = BUILD of %s:%s BROKEN on %s with %s AT REVISION %s % (tree, t.branch, host, compiler, cur_rev) msg[From] = \Build Farm\ bu...@samba.org msg[To] = ,.join(recipients.keys()) -smtp.send(msg[From], [msg[To]], msg.as_string()) +if not opts.dry_run: +smtp.send(msg[From], [msg[To]], msg.as_string()) for build in buildfarm.get_new_builds(): -if opts.verbose = 2: +if opts.verbose = 1: print Processing %s... % build -buildfarm.builds.upload_build(build) +if not opts.dry_run: +buildfarm.builds.upload_build(build) (rev, commit_rev, rev_timestamp) = build.revision_details() @@ -103,6 +101,7 @@ for build in buildfarm.get_new_builds(): prev_build = buildfarm.get_build(build.tree, build.host, build.compiler, prev_rev) check_and_send_mails(build.tree, build.host, build.compiler, build, prev_build) -build.remove() +if not opts.dry_run: +build.remove() smtp.quit() diff --git a/mail-dead-hosts.py b/mail-dead-hosts.py index 1a26264..1a73974 100755 --- a/mail-dead-hosts.py +++ b/mail-dead-hosts.py @@ -20,20 +20,24 @@ from buildfarm import ( BuildFarm, ) +import optparse import smtplib from email.MIMEText import MIMEText import time +parser = optparse.OptionParser() +parser.add_option(--dry-run, help=Don't actually send any emails., action=store_true) +(opts, args) = parser.parse_args() + buildfarm = BuildFarm() db = buildfarm.hostdb -dry_run = False hosts = db.dead_hosts(7 * 86400) for host in hosts: db.sent_dead_mail(host.name) if host.last_update: -last_update = time.strftime (%a %b %e %H:%M:%S %Y, time.gmtime(host.last_update)) +last_update = time.strftime(%a %b %e %H:%M:%S %Y, time.gmtime(host.last_update)) else: last_update = a long time @@ -66,7 +70,7 @@ The Build Farm administration team. msg[From] = \Samba Build Farm\ bu...@samba.org msg[To] = \%s\ %s % host.owner -if dry_run: +if opts.dry_run: print msg.as_string() else: s = smtplib.SMTP() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via f6aa956 Keep connection open while sending dead host notifications, only mark mail sent when not using dry run. from 6b5ee74 Honor dry_run in import-and-analyse. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit f6aa956149f3c1d68d386fc2c87e6e3f56895850 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 19:59:08 2010 +0100 Keep connection open while sending dead host notifications, only mark mail sent when not using dry run. --- Summary of changes: mail-dead-hosts.py | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/mail-dead-hosts.py b/mail-dead-hosts.py index 1a73974..f9a5807 100755 --- a/mail-dead-hosts.py +++ b/mail-dead-hosts.py @@ -32,10 +32,11 @@ parser.add_option(--dry-run, help=Don't actually send any emails., action=s buildfarm = BuildFarm() db = buildfarm.hostdb +smtp = smtplib.SMTP() +smtp.connect() + hosts = db.dead_hosts(7 * 86400) for host in hosts: -db.sent_dead_mail(host.name) - if host.last_update: last_update = time.strftime(%a %b %e %H:%M:%S %Y, time.gmtime(host.last_update)) else: @@ -73,7 +74,6 @@ The Build Farm administration team. if opts.dry_run: print msg.as_string() else: -s = smtplib.SMTP() -s.connect() -s.send(msg[From], [msg[To]], msg.as_string()) -s.quit() +smtp.send(msg[From], [msg[To]], msg.as_string()) +db.sent_dead_mail(host.name) +smtp.quit() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 5b70bb5 Switch over to using python mail-dead-hosts scripts. from f6aa956 Keep connection open while sending dead host notifications, only mark mail sent when not using dry run. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 5b70bb59f78911581d912e0aeeb317658e255bf6 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:01:12 2010 +0100 Switch over to using python mail-dead-hosts scripts. --- Summary of changes: daily.sh |2 +- mail-dead-hosts.pl | 88 2 files changed, 1 insertions(+), 89 deletions(-) delete mode 100755 mail-dead-hosts.pl Changeset truncated at 500 lines: diff --git a/daily.sh b/daily.sh index f57536c..8bc5304 100755 --- a/daily.sh +++ b/daily.sh @@ -7,7 +7,7 @@ set -x date set -x sqlite3 `dirname $0`/hostdb.sqlite 'VACUUM;' -cd `dirname $0` ./mail-dead-hosts.pl +cd `dirname $0` ./mail-dead-hosts.py echo deleting old file that are not used any more find `dirname $0`/data/oldrevs -type f -mtime +10 -links 1 -print0 | xargs -i -0 rm -f \{\} diff --git a/mail-dead-hosts.pl b/mail-dead-hosts.pl deleted file mode 100755 index 9ebaa7a..000 --- a/mail-dead-hosts.pl +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/perl -# Samba.org buildfarm -# Copyright (C) 2008 Andrew Bartlett abart...@samba.org -# Copyright (C) 2008 Jelmer Vernooij jel...@samba.org -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# - -use FindBin qw($RealBin); -use POSIX qw(strftime); -use hostdb; -use Mail::Send; -use warnings; -use strict; - -my $db = new hostdb($RealBin/hostdb.sqlite) or die(Unable to connect to host database: $!); -my $dry_run = 0; - -my $hosts = $db-dead_hosts(7 * 86400); -foreach (@$hosts) { - - my ($fh, $msg); - - $db-sent_dead_mail($_-{host}) or die Could not update 'last dead mail sent' record for $_-{host}; - - # send an e-mail to the owner - my $subject = Your build farm host $_-{host} appears dead; - if ($dry_run) { - print To: $_-{owner} $_-{owner_email}\n; - print Subject: $subject\n; - open(MAIL,|cat); - } else { - $msg = new Mail::Send(Subject=$subject, To=bui...@samba.org); - $msg-set(From, \Samba Build Farm\ \bui...@samba.org\); - $fh = $msg-open; - } - -my $last_update; - if (defined($_-{last_update})) { - $last_update = strftime (%a %b %e %H:%M:%S %Y, gmtime($_-{last_update})); - } else { - $last_update = a long time; - } - - my $body = __EOF__; -Your host $_-{host} has been part of the Samba Build farm, hosted -at http://build.samba.org. - -Sadly however we have not heard from it since $last_update. - -Could you see if something has changed recently, and examine the logs -(typically in ~build/build_farm/build.log and ~build/cron.err) to see -why we have not heard from your host? - -If you no longer wish your host to participate in the Samba Build -Farm, then please let us know so we can remove its records. - -You can see the summary for your host at: -http://build.samba.org/?function=View+Host;host=$_-{host} - -Thanks, - -The Build Farm administration team. - -__EOF__ - - if ($dry_run) { - print MAIL $body; - - close(MAIL); - } else { - print $fh $body; - $fh-close; - } -} - -1; -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 109bec3 admin: Only update hosts list/rsyncd secrets when changes have been made. from 5b70bb5 Switch over to using python mail-dead-hosts scripts. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 109bec3e1147caff0352fe7e57a47d1e532f7385 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:05:24 2010 +0100 admin: Only update hosts list/rsyncd secrets when changes have been made. --- Summary of changes: admin.py | 38 +++--- 1 files changed, 23 insertions(+), 15 deletions(-) Changeset truncated at 500 lines: diff --git a/admin.py b/admin.py index 909d303..f17b26e 100755 --- a/admin.py +++ b/admin.py @@ -32,6 +32,22 @@ buildfarm = BuildFarm() db = buildfarm.hostdb +def update_rsyncd_secrets(): +temp_rsyncd_secrets = os.path.join(os.path.dirname(__file__), ../rsyncd.secrets.new) +f = open(temp_rsyncd_secrets, w) +f.writelines(db.create_rsync_secrets()) +f.close() + +os.rename(temp_rsyncd_secrets, ../rsyncd.secrets) + +def update_hosts_list(): +temp_hosts_list_file = os.path.join(os.path.dirname(__file__), web, hosts.list.new) +f = open(temp_hosts_list_file, w) +f.writelines(db.create_hosts_list()) +f.close() + +os.rename(temp_hosts_list_file, os.path.join(os.path.dirname(__file__), web/hosts.list)) + dry_run = False print Samba Build farm management tool @@ -58,6 +74,9 @@ if op == remove: except hostdb.NoSuchHost, e: print No such host '%s' % e.name sys.exit(1) +else: +update_rsyncd_secrets() +update_hosts_list() elif op == modify: hostname = raw_input(Please enter hostname to modify: ) host = db.host(hostname) @@ -85,6 +104,8 @@ elif op == modify: else: print Unknown subcommand %s % mod_op sys.exit(1) +update_rsyncd_secrets() +update_hosts_list() elif op == add: hostname = raw_input(Machine hostname: ) platform = raw_input(Machine platform (eg Fedora 9 x86_64): ) @@ -155,7 +176,8 @@ Thanks, your friendly Samba build farm administrator bu...@samba.org % owne recipients.append(msg[Bcc]) s.sendmail(msg[From], recipients, msg.as_string()) s.quit() - +update_rsyncd_secrets() +update_hosts_list() elif op == info: hostname = raw_input(Hostname: ) host = db.host(hostname) @@ -179,17 +201,3 @@ elif op == list: else: print Unknown command %s % op sys.exit(1) - -temp_rsyncd_secrets = os.path.join(os.path.dirname(__file__), ../rsyncd.secrets.new) -f = open(temp_rsyncd_secrets, w) -f.writelines(db.create_rsync_secrets()) -f.close() - -os.rename(temp_rsyncd_secrets, ../rsyncd.secrets) - -temp_hosts_list_file = os.path.join(os.path.dirname(__file__), web, hosts.list.new) -f = open(temp_hosts_list_file, w) -f.writelines(db.create_hosts_list()) -f.close() - -os.rename(temp_hosts_list_file, os.path.join(os.path.dirname(__file__), web/hosts.list)) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 5e622dd Fix new build fetching. from 109bec3 admin: Only update hosts list/rsyncd secrets when changes have been made. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 5e622dd560d6fc78ec29b6656493c2f8108f Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:07:39 2010 +0100 Fix new build fetching. --- Summary of changes: buildfarm/__init__.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 06b2d31..fe1949d 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -137,7 +137,7 @@ class BuildFarm(object): # hosts, trees and compilers as input, we ensure we # control the inputs try: -yield self.upload_builds.get_build(host, tree, compiler) +yield self.upload_builds.get_build(host.name, tree, compiler) except data.NoSuchBuildError: continue -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 83a49ae Fix argument order. from 5e622dd Fix new build fetching. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 83a49ae36791317edc59938ced87f99c03c1485e Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:09:40 2010 +0100 Fix argument order. --- Summary of changes: buildfarm/__init__.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index fe1949d..a608f79 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -137,7 +137,7 @@ class BuildFarm(object): # hosts, trees and compilers as input, we ensure we # control the inputs try: -yield self.upload_builds.get_build(host.name, tree, compiler) +yield self.upload_builds.get_build(tree, host.name, compiler) except data.NoSuchBuildError: continue -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via b5385e7 Provide stub get_previous_revision. from 83a49ae Fix argument order. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit b5385e7133e3fe38ff01d328a92d0dec02d685f1 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:12:08 2010 +0100 Provide stub get_previous_revision. --- Summary of changes: buildfarm/data.py |3 +++ import-and-analyse.py |4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 9f982db..24e05d7 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -459,6 +459,9 @@ class BuildResultStore(object): # $st = $dbh-prepare(INSERT INTO build (tree, revision, commit_revision, host, compiler, checksum, age, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)) # $st-execute($tree, $rev, $commit, $host, $compiler, $checksum, $stat-ctime, $status_html) +def get_previous_revision(self, tree, host, compiler, revision): +raise NoSuchBuildError(self): + def get_previous_revision(self, tree, host, compiler, revision): # Look up the database to find the previous status diff --git a/import-and-analyse.py b/import-and-analyse.py index f1b90f5..89dae0a 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -12,7 +12,7 @@ on recent commits. from buildfarm import ( BuildFarm, -hostdb, +data, ) from email.mime.text import MIMEText import logging @@ -94,7 +94,7 @@ for build in buildfarm.get_new_builds(): try: prev_rev = buildfarm.builds.get_previous_revision(build.tree, build.host, build.compiler, rev) -except hostdb.NoSuchBuild: +except data.NoSuchBuild: # Can't send a nastygram until there are 2 builds.. continue else: -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 2bed1d2 More fixes, implement Build.__repr__. from b5385e7 Provide stub get_previous_revision. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 2bed1d2b6c98b303021497e312831053a1d9eb37 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:17:09 2010 +0100 More fixes, implement Build.__repr__. --- Summary of changes: buildfarm/data.py|8 +++- buildfarm/tests/test_data.py |5 + import-and-analyse.py|2 +- 3 files changed, 13 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 24e05d7..8c30b7e 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -177,6 +177,12 @@ class Build(object): self.compiler = compiler self.rev = rev +def __repr__(self): +if self.rev: +return %s: revision %s of %s on %s using %s % (self.__class__.__name__, self.rev, self.tree, self.host, self.compiler) +else: +return %s: %s on %s using %s % (self.__class__.__name__, self.tree, self.host, self.compiler) + def remove(self): os.unlink(self.basename + .log) if os.path.exists(self.basename+.err): @@ -460,7 +466,7 @@ class BuildResultStore(object): # $st-execute($tree, $rev, $commit, $host, $compiler, $checksum, $stat-ctime, $status_html) def get_previous_revision(self, tree, host, compiler, revision): -raise NoSuchBuildError(self): +raise NoSuchBuildError(tree, host, compiler, revision) def get_previous_revision(self, tree, host, compiler, revision): diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 43451da..f89cfb1 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -47,6 +47,11 @@ class BuildResultStoreTestBase(object): self.assertFalse(os.path.exists(path)) self.assertRaises(data.NoSuchBuildError, self.x.get_build, tdb, charis, cc, 12) +def test_build_repr(self): +path = self.create_mock_logfile(tdb, charis, cc, 12) +build = self.x.get_build(tdb, charis, cc, 12) +self.assertEquals(%s: revision 12 of tdb on charis using cc % build.__class__.__name__, repr(build)) + def test_build_age_mtime(self): path = self.create_mock_logfile(tdb, charis, cc, 12) # Set mtime to something in the past diff --git a/import-and-analyse.py b/import-and-analyse.py index 89dae0a..9431f56 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -94,7 +94,7 @@ for build in buildfarm.get_new_builds(): try: prev_rev = buildfarm.builds.get_previous_revision(build.tree, build.host, build.compiler, rev) -except data.NoSuchBuild: +except data.NoSuchBuildError: # Can't send a nastygram until there are 2 builds.. continue else: -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 437a715 Print build status when verbose. from 2bed1d2 More fixes, implement Build.__repr__. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 437a715153314191c986297e358af81709ccb689 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:21:03 2010 +0100 Print build status when verbose. --- Summary of changes: buildfarm/data.py |5 + import-and-analyse.py |5 - 2 files changed, 9 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 8c30b7e..4e4138d 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -52,6 +52,11 @@ class BuildStatus(object): else: self.other_failures = set() +def __str__(self): +if self.other_failures: +return ,.join(self.other_failures) +return /.join([x[1] for x in self.stages]) + def broken_host(self): if disk full in self.other_failures: return True diff --git a/import-and-analyse.py b/import-and-analyse.py index 9431f56..def3428 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -85,13 +85,16 @@ The build may have been broken by one of the following commits: for build in buildfarm.get_new_builds(): if opts.verbose = 1: -print Processing %s... % build +print Processing %s... % build, if not opts.dry_run: buildfarm.builds.upload_build(build) (rev, commit_rev, rev_timestamp) = build.revision_details() +if opts.verbose = 1: +print str(build.status()) + try: prev_rev = buildfarm.builds.get_previous_revision(build.tree, build.host, build.compiler, rev) except data.NoSuchBuildError: -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 969a9d5 Unconfuse repr and str for BuildStatus. from 437a715 Print build status when verbose. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 969a9d523ab757bc4abf49ed1d818cabb5d4fd5e Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 20:24:27 2010 +0100 Unconfuse repr and str for BuildStatus. --- Summary of changes: buildfarm/data.py | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 4e4138d..fb34ad7 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -55,7 +55,7 @@ class BuildStatus(object): def __str__(self): if self.other_failures: return ,.join(self.other_failures) -return /.join([x[1] for x in self.stages]) +return /.join(self._status_tuple()) def broken_host(self): if disk full in self.other_failures: @@ -89,8 +89,8 @@ class BuildStatus(object): else: return cmp(other.stages, self.stages) -def __str__(self): -return repr((self.stages, self.other_failures)) +def __repr__(self): +return %s(%r) % (self.__class__.__name__, (self.stages, self.other_failures)) def check_dir_exists(kind, path): @@ -346,12 +346,12 @@ class CachingBuild(Build): st2 = None if st2 and st1.st_ctime = st2.st_mtime: -return BuildStatus(*eval(util.FileLoad(cachefile))) +return eval(util.FileLoad(cachefile)) ret = super(CachingBuild, self).status() if not self._store.readonly: -util.FileSave(cachefile, str(ret)) +util.FileSave(cachefile, repr(ret)) return ret -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 99b7f0c Simplify revision_details() call. via 720b006 Add upload_build for sqlite. via 081607d add initial code for sql backed build result data. from fdfaa5a Scan for builds then verify, rather than probing. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 99b7f0ce3b11bddac4580c9c0faec01085bad04c Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 23:12:53 2010 +0100 Simplify revision_details() call. commit 720b006124fd809bf38ca37d44367d107778e813 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 23:08:22 2010 +0100 Add upload_build for sqlite. commit 081607dfd99532b299e19df82dfc36b543502ed8 Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 22:51:50 2010 +0100 add initial code for sql backed build result data. --- Summary of changes: buildfarm/__init__.py | 10 buildfarm/data.py | 89 ++--- buildfarm/hostdb.py |9 +--- buildfarm/tests/test_buildfarm.py |4 +- buildfarm/tests/test_data.py | 19 ++-- web/build.py | 12 + 6 files changed, 74 insertions(+), 69 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 40522f7..822dc1f 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -185,3 +185,13 @@ class CachingBuildFarm(BuildFarm): if not self.readonly: util.FileSave(cachefile, perc) return perc + + +def setup_db(db): +db.executescript( +CREATE TABLE IF NOT EXISTS host (name text, owner text, owner_email text, password text, ssh_access int, fqdn text, platform text, permission text, last_dead_mail int, join_time int); +CREATE UNIQUE INDEX IF NOT EXISTS unique_hostname ON host (name); +CREATE TABLE IF NOT EXISTS build (id integer primary key autoincrement, tree text, revision text, host text, compiler text, checksum text, age int, status text, commit_revision text); +CREATE UNIQUE INDEX IF NOT EXISTS unique_checksum ON build (checksum); +CREATE TABLE IF NOT EXISTS test_run (build int, test text, result text, output text); +) diff --git a/buildfarm/data.py b/buildfarm/data.py index 0eaae74..888aa73 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -21,22 +21,23 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - +from buildfarm import setup_db from cStringIO import StringIO import hashlib import os import re +import sqlite3 import time import util class BuildSummary(object): -def __init__(self, host, tree, compiler, rev, status): +def __init__(self, host, tree, compiler, revision, status): self.host = host self.tree = tree self.compiler = compiler -self.rev = rev +self.revision = revision self.status = status @@ -180,11 +181,11 @@ class Build(object): self.tree = tree self.host = host self.compiler = compiler -self.rev = rev +self.revision = rev def __repr__(self): -if self.rev: -return %s: revision %s of %s on %s using %s % (self.__class__.__name__, self.rev, self.tree, self.host, self.compiler) +if self.revision: +return %s: revision %s of %s on %s using %s % (self.__class__.__name__, self.revision, self.tree, self.host, self.compiler) else: return %s: %s on %s using %s % (self.__class__.__name__, self.tree, self.host, self.compiler) @@ -228,9 +229,7 @@ class Build(object): f.close() def summary(self): -(revid, commit_revid, timestamp) = self.revision_details() -if commit_revid: -revid = commit_revid +(revid, timestamp) = self.revision_details() status = self.status() return BuildSummary(self.host, self.tree, self.compiler, revid, status) @@ -239,23 +238,19 @@ class Build(object): :return: Tuple with revision id and timestamp (if available) - revid = None -commit_revid = None timestamp = None f = self.read_log() try: for l in f: if l.startswith(BUILD COMMIT REVISION: ): -commit_revid = l.split(:, 1)[1].strip() -elif l.startswith(BUILD REVISION: ): revid = l.split(:, 1)[1].strip() elif l.startswith(BUILD COMMIT TIME): timestamp = l.split(:, 1)[1].strip() finally: f.close() -return (revid, commit_revid, timestamp) +return (revid, timestamp) def status(self
[SCM] build.samba.org - branch master updated
The branch, master has been updated via ff35138 Some fixes for import-and-analyse. from 99b7f0c Simplify revision_details() call. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit ff351382411e200315fed46515a96dc7f55b34af Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 00:11:20 2010 +0100 Some fixes for import-and-analyse. --- Summary of changes: import-and-analyse.py |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/import-and-analyse.py b/import-and-analyse.py index def3428..d88d42c 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -41,7 +41,7 @@ def check_and_send_mails(tree, host, compiler, cur, old): old_status = old.status() if not cur_status.regressed_since(old_status): -if opts.verbose: +if opts.verbose = 1: print the build didn't get worse since %r % old_status return @@ -81,6 +81,8 @@ The build may have been broken by one of the following commits: msg[To] = ,.join(recipients.keys()) if not opts.dry_run: smtp.send(msg[From], [msg[To]], msg.as_string()) +else: +print msg.as_string() for build in buildfarm.get_new_builds(): @@ -90,7 +92,7 @@ for build in buildfarm.get_new_builds(): if not opts.dry_run: buildfarm.builds.upload_build(build) -(rev, commit_rev, rev_timestamp) = build.revision_details() +(rev, rev_timestamp) = build.revision_details() if opts.verbose = 1: print str(build.status()) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via ba21c21 Use commit_revision rather revision. from ff35138 Some fixes for import-and-analyse. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit ba21c210a563c33262695a0f73edbb3e30d56f82 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 00:20:14 2010 +0100 Use commit_revision rather revision. --- Summary of changes: buildfarm/data.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 888aa73..451caa5 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -503,7 +503,7 @@ class SQLCachingBuildResultStore(BuildResultStore): self.db = db def get_previous_revision(self, tree, host, compiler, revision): -cursor = self.db.execute(SELECT revision FROM build WHERE tree = ? AND host = ? AND compiler = ? AND revision ? ORDER BY id DESC LIMIT 1, (tree, host, compiler, revision)) +cursor = self.db.execute(SELECT commit_revision FROM build WHERE tree = ? AND host = ? AND compiler = ? AND commit_revision ? ORDER BY id DESC LIMIT 1, (tree, host, compiler, revision)) row = cursor.fetchone() if row is None: raise NoSuchBuildError(tree, host, compiler, revision) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 92dcfd6 Use sqlite backed buildfarm in import-and-analyse. via 64392cb Add sql caching buildfarm. from ba21c21 Use commit_revision rather revision. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 92dcfd6261517d1972952b8e674f0ae0975fc63f Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 00:32:59 2010 +0100 Use sqlite backed buildfarm in import-and-analyse. commit 64392cb86d34dadeb1329b4c4419229b5ad96c91 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 00:30:57 2010 +0100 Add sql caching buildfarm. --- Summary of changes: buildfarm/__init__.py | 19 +++ buildfarm/tests/__init__.py |5 + buildfarm/tests/test_buildfarm.py |9 + import-and-analyse.py |5 ++--- 4 files changed, 35 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 822dc1f..6b44309 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -20,6 +20,7 @@ import ConfigParser import os import re +import sqlite3 class Tree(object): @@ -187,6 +188,24 @@ class CachingBuildFarm(BuildFarm): return perc +class SQLCachingBuildFarm(BuildFarm): + +def __init__(self, path=None, db=None): +self.db = db +super(SQLCachingBuildFarm, self).__init__(path) + +def _get_db(self): +if self.db is not None: +return self.db +else: +return sqlite3.connect(os.path.join(self.path, hostdb.sqlite)) + +def _open_build_results(self): +from buildfarm import data +return data.SQLCachingBuildResultStore(os.path.join(self.path, data, oldrevs), +self.db) + + def setup_db(db): db.executescript( CREATE TABLE IF NOT EXISTS host (name text, owner text, owner_email text, password text, ssh_access int, fqdn text, platform text, permission text, last_dead_mail int, join_time int); diff --git a/buildfarm/tests/__init__.py b/buildfarm/tests/__init__.py index 65912f8..046d1fa 100644 --- a/buildfarm/tests/__init__.py +++ b/buildfarm/tests/__init__.py @@ -15,7 +15,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +from buildfarm import setup_db import os +import sqlite3 from testtools import TestCase import shutil import tempfile @@ -72,6 +74,9 @@ class BuildFarmTestCase(TestCase): for subdir in [data, data/upload, data/oldrevs, cache, web, lcov, lcov/data]: os.mkdir(os.path.join(self.path, subdir)) +db = sqlite3.connect(os.path.join(self.path, hostdb.sqlite)) +setup_db(db) + def tearDown(self): shutil.rmtree(self.path) super(BuildFarmTestCase, self).tearDown() diff --git a/buildfarm/tests/test_buildfarm.py b/buildfarm/tests/test_buildfarm.py index 02eda60..2927f72 100644 --- a/buildfarm/tests/test_buildfarm.py +++ b/buildfarm/tests/test_buildfarm.py @@ -18,6 +18,7 @@ from buildfarm import ( BuildFarm, CachingBuildFarm, +SQLCachingBuildFarm, data, read_trees_from_conf, ) @@ -126,3 +127,11 @@ class CachingBuildFarmTests(BuildFarmTestBase, BuildFarmTestCase): BuildFarmTestCase.setUp(self) BuildFarmTestBase.setUp(self) self.x = CachingBuildFarm(self.path) + + +class SQLCachingBuildFarmTests(BuildFarmTestBase, BuildFarmTestCase): + +def setUp(self): +BuildFarmTestCase.setUp(self) +BuildFarmTestBase.setUp(self) +self.x = SQLCachingBuildFarm(self.path) diff --git a/import-and-analyse.py b/import-and-analyse.py index d88d42c..726407e 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -11,7 +11,7 @@ on recent commits. from buildfarm import ( -BuildFarm, +SQLCachingBuildFarm, data, ) from email.mime.text import MIMEText @@ -25,8 +25,7 @@ parser.add_option(--verbose, help=Be verbose, action=count) (opts, args) = parser.parse_args() -# we open readonly here as only apache(www-run) has write access -buildfarm = BuildFarm() +buildfarm = SQLCachingBuildFarm() smtp = smtplib.SMTP() smtp.connect() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via fb29f3a Fix implementation of get_previous_revision. from 92dcfd6 Use sqlite backed buildfarm in import-and-analyse. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit fb29f3ae2b0622b3cf1a48008e7d1e856bfd4da7 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 01:15:34 2010 +0100 Fix implementation of get_previous_revision. --- Summary of changes: buildfarm/data.py| 10 -- buildfarm/tests/test_data.py | 13 + 2 files changed, 21 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 451caa5..7e6497a 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -503,7 +503,12 @@ class SQLCachingBuildResultStore(BuildResultStore): self.db = db def get_previous_revision(self, tree, host, compiler, revision): -cursor = self.db.execute(SELECT commit_revision FROM build WHERE tree = ? AND host = ? AND compiler = ? AND commit_revision ? ORDER BY id DESC LIMIT 1, (tree, host, compiler, revision)) +cursor = self.db.execute(SELECT id FROM build WHERE tree = ? AND host = ? AND compiler = ? AND commit_revision = ?, (tree, host, compiler, revision)) +row = cursor.fetchone() +if row is None: +raise NoSuchBuildError(tree, host, compiler, revision) +dbid = row[0] +cursor = self.db.execute(SELECT commit_revision FROM build WHERE tree = ? AND host = ? AND compiler = ? AND id ? ORDER BY id DESC LIMIT 1, (tree, host, compiler, dbid)) row = cursor.fetchone() if row is None: raise NoSuchBuildError(tree, host, compiler, revision) @@ -511,4 +516,5 @@ class SQLCachingBuildResultStore(BuildResultStore): def upload_build(self, build): super(SQLCachingBuildResultStore, self).upload_build(build) -self.db.execute(INSERT INTO build (tree, revision, commit_revision, host, compiler, checksum, age, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?), (build.tree, build.revision, build.revision, build.host, build.compiler, build.log_checksum(), build.age_mtime(), repr(build.status( +rev, timestamp = build.revision_details() +self.db.execute(INSERT INTO build (tree, revision, commit_revision, host, compiler, checksum, age, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?), (build.tree, rev, rev, build.host, build.compiler, build.log_checksum(), timestamp, repr(build.status( diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 4b60ad8..60f6597 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -168,6 +168,19 @@ class SQLCachingBuildResultStoreTests(BuildFarmTestCase,BuildResultStoreTestBase self.x = data.SQLCachingBuildResultStore( os.path.join(self.path, data, oldrevs)) +def test_get_previous_revision_result(self): +path = self.create_mock_logfile(tdb, charis, cc, contents= +BUILD COMMIT REVISION: myrev +) +self.x.upload_build(data.Build(None, path[:-4], tdb, charis, cc)) +path = self.create_mock_logfile(tdb, charis, cc, contents= +BUILD COMMIT REVISION: myotherrev +) +self.x.upload_build(data.Build(None, path[:-4], tdb, charis, cc)) +self.assertRaises(data.NoSuchBuildError, self.x.get_previous_revision, tdb, charis, cc, unknown) +self.assertRaises(data.NoSuchBuildError, self.x.get_previous_revision, tdb, charis, cc, myrev) +self.assertEquals(myrev, self.x.get_previous_revision(tdb, charis, cc, myotherrev)) + class BuildStatusFromLogs(testtools.TestCase): -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via a4a34ad Cope with import-and-analyse dry runs. from fb29f3a Fix implementation of get_previous_revision. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit a4a34ad0eef1d87c001840b24acb6d90ff8468ee Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 01:22:21 2010 +0100 Cope with import-and-analyse dry runs. --- Summary of changes: buildfarm/data.py| 10 ++ buildfarm/tests/test_data.py |9 + import-and-analyse.py|8 ++-- 3 files changed, 25 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 7e6497a..5518ce4 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -469,6 +469,9 @@ class BuildResultStore(object): def get_previous_revision(self, tree, host, compiler, revision): raise NoSuchBuildError(tree, host, compiler, revision) +def get_latest_revision(self, tree, host, compiler): +raise NoSuchBuildError(tree, host, compiler) + class CachingBuildResultStore(BuildResultStore): @@ -514,6 +517,13 @@ class SQLCachingBuildResultStore(BuildResultStore): raise NoSuchBuildError(tree, host, compiler, revision) return row[0] +def get_latest_revision(self, tree, host, compiler): +cursor = self.db.execute(SELECT commit_revision FROM build WHERE tree = ? AND host = ? AND compiler = ? ORDER BY id DESC LIMIT 1, (tree, host, compiler)) +row = cursor.fetchone() +if row is None: +raise NoSuchBuildError(tree, host, compiler) +return row[0] + def upload_build(self, build): super(SQLCachingBuildResultStore, self).upload_build(build) rev, timestamp = build.revision_details() diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 60f6597..d432cfa 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -134,6 +134,8 @@ BUILD COMMIT REVISION: myrev def test_get_previous_revision(self): self.assertRaises(data.NoSuchBuildError, self.x.get_previous_revision, tdb, charis, cc, 12) +def test_get_latest_revision_none(self): +self.assertRaises(data.NoSuchBuildError, self.x.get_latest_revision, tdb, charis, cc) class BuildResultStoreTests(BuildFarmTestCase,BuildResultStoreTestBase): @@ -181,6 +183,13 @@ BUILD COMMIT REVISION: myotherrev self.assertRaises(data.NoSuchBuildError, self.x.get_previous_revision, tdb, charis, cc, myrev) self.assertEquals(myrev, self.x.get_previous_revision(tdb, charis, cc, myotherrev)) +def test_get_latest_revision(self): +path = self.create_mock_logfile(tdb, charis, cc, 22, contents= +BUILD COMMIT REVISION: myrev +) +self.x.upload_build(data.Build(None, path[:-4], tdb, charis, cc)) +self.assertEquals(myrev, self.x.get_latest_revision(tdb, charis, cc)) + class BuildStatusFromLogs(testtools.TestCase): diff --git a/import-and-analyse.py b/import-and-analyse.py index 726407e..fc24edf 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -99,8 +99,12 @@ for build in buildfarm.get_new_builds(): try: prev_rev = buildfarm.builds.get_previous_revision(build.tree, build.host, build.compiler, rev) except data.NoSuchBuildError: -# Can't send a nastygram until there are 2 builds.. -continue +try: +# Perhaps this is a dry run and rev is not in the database yet? +prev_rev = buildfarm.builds.get_latest_revision(build.tree, build.host, build.compiler) +except data.NoSuchBuildError: +# Can't send a nastygram until there are 2 builds.. +continue else: prev_build = buildfarm.get_build(build.tree, build.host, build.compiler, prev_rev) check_and_send_mails(build.tree, build.host, build.compiler, build, prev_build) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 2a37ec3 Be verbose when there's no previous build. from a4a34ad Cope with import-and-analyse dry runs. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 2a37ec38f1335160ed066bfc9f46797092b8df09 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 13 01:24:51 2010 +0100 Be verbose when there's no previous build. --- Summary of changes: import-and-analyse.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/import-and-analyse.py b/import-and-analyse.py index fc24edf..8db0618 100755 --- a/import-and-analyse.py +++ b/import-and-analyse.py @@ -103,6 +103,8 @@ for build in buildfarm.get_new_builds(): # Perhaps this is a dry run and rev is not in the database yet? prev_rev = buildfarm.builds.get_latest_revision(build.tree, build.host, build.compiler) except data.NoSuchBuildError: +if opts.verbose = 1: +print Unable to find previous build for %s,%s,%s % (build.tree, build.host, build.compiler) # Can't send a nastygram until there are 2 builds.. continue else: -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 46d2d55 Reintroduce readonly parameter, remove unnecessary code. from d67fc5a Use the correct form for cmp http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 46d2d555c366289981592c9b3e9df75d9f2b84c3 Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 22:17:21 2010 +0100 Reintroduce readonly parameter, remove unnecessary code. --- Summary of changes: buildfarm/__init__.py | 22 +++--- 1 files changed, 7 insertions(+), 15 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 51d4968..ea5ecbd 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -135,30 +135,26 @@ class BuildFarm(object): class CachingBuildFarm(BuildFarm): -def __init__(self, path=None, cachedirname=None): -self.cachedir = None +def __init__(self, path=None, readonly=False, cachedirname=None): super(CachingBuildFarm, self).__init__(path) if cachedirname: self.cachedir = os.path.join(self.path, cachedirname) else: -self.cachedir = os.path.join(self.path, cache2) +self.cachedir = os.path.join(self.path, cache) self.builds = self._open_build_results() self.upload_builds = self._open_upload_build_results() +self.readonly = readonly def _open_build_results(self): from buildfarm import data -if not self.cachedir: -return return data.CachingBuildResultStore(os.path.join(self.path, data, oldrevs), -self.cachedir) +self.cachedir, reaodnly=self.readonly) def _open_upload_build_results(self): from buildfarm import data -if not self.cachedir: -return return data.CachingUploadBuildResultStore(os.path.join(self.path, data, upload), -self.cachedir) +self.cachedir, readonly=self.readonly) def lcov_status(self, tree): get status of build @@ -183,11 +179,7 @@ class CachingBuildFarm(BuildFarm): return None return ret -lcov_html = util.FileLoad(file) -perc = lcov_extract_percentage(lcov_html) -if perc is None: -ret = -else: -ret = perc +perc = super(CachingBuildFarm, self).lcov_status(tree) +if not self.readonly: util.FileSave(cachefile, ret) return perc -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 3de05b3 Add some more base buildfarm tests. via 23a0e49 Fix caching buildfarm. via 324bb02 make import-and-analyse executable. from 46d2d55 Reintroduce readonly parameter, remove unnecessary code. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 3de05b3e869488cf6d8eb395a3086377254e3c35 Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 22:56:15 2010 +0100 Add some more base buildfarm tests. commit 23a0e4992b633a6e44c0dcfdf24702e2456b4e4a Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 22:41:46 2010 +0100 Fix caching buildfarm. commit 324bb026c566f8ea0e796adaccf584e7bb8e7d23 Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 22:38:35 2010 +0100 make import-and-analyse executable. --- Summary of changes: buildfarm/__init__.py | 21 buildfarm/tests/__init__.py | 63 buildfarm/tests/test_buildfarm.py | 95 + 3 files changed, 106 insertions(+), 73 deletions(-) create mode 100644 buildfarm/tests/test_buildfarm.py mode change 100644 = 100755 import-and-analyse.py Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index ea5ecbd..fdb197c 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -49,6 +49,7 @@ def read_trees_from_conf(path): def lcov_extract_percentage(text): +Extract the coverage percentage from the lcov file. m = re.search('\td class=headerItem.*?\Code\nbsp\;covered\:\\/td\.*?\n.*?\td class=headerValue.*?\([0-9.]+) \%', text) if m: return m.group(1) @@ -102,7 +103,7 @@ class BuildFarm(object): file = os.path.join(self.lcovdir, self.LCOVHOST, tree, index.html) try: lcov_html = util.FileLoad(file) -except OSError: +except (OSError, IOError): # File does not exist raise data.NoSuchBuildError(tree, self.LCOVHOST, lcov) @@ -136,30 +137,30 @@ class BuildFarm(object): class CachingBuildFarm(BuildFarm): def __init__(self, path=None, readonly=False, cachedirname=None): +self._cachedirname = cachedirname +self.readonly = readonly super(CachingBuildFarm, self).__init__(path) -if cachedirname: -self.cachedir = os.path.join(self.path, cachedirname) +def _get_cachedir(self): +if self._cachedirname is not None: +return os.path.join(self.path, self._cachedirname) else: -self.cachedir = os.path.join(self.path, cache) -self.builds = self._open_build_results() -self.upload_builds = self._open_upload_build_results() -self.readonly = readonly +return os.path.join(self.path, cache) def _open_build_results(self): from buildfarm import data return data.CachingBuildResultStore(os.path.join(self.path, data, oldrevs), -self.cachedir, reaodnly=self.readonly) +self._get_cachedir(), readonly=self.readonly) def _open_upload_build_results(self): from buildfarm import data return data.CachingUploadBuildResultStore(os.path.join(self.path, data, upload), -self.cachedir, readonly=self.readonly) +self._get_cachedir(), readonly=self.readonly) def lcov_status(self, tree): get status of build from buildfarm import data, util -cachefile = os.path.join(self.cachedir, +cachefile = os.path.join(self._get_cachedir(), lcov.%s.%s.status % (self.LCOVHOST, tree)) file = os.path.join(self.lcovdir, self.LCOVHOST, tree, index.html) try: diff --git a/buildfarm/tests/__init__.py b/buildfarm/tests/__init__.py index c414bb1..65912f8 100644 --- a/buildfarm/tests/__init__.py +++ b/buildfarm/tests/__init__.py @@ -15,13 +15,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -from buildfarm import BuildFarm - import os from testtools import TestCase import shutil import tempfile -import testtools class BuildFarmTestCase(TestCase): @@ -78,63 +75,3 @@ class BuildFarmTestCase(TestCase): def tearDown(self): shutil.rmtree(self.path) super(BuildFarmTestCase, self).tearDown() - - -class ReadTreesFromConfTests(testtools.TestCase): - -def create_file(self, contents): -(fd, path) = tempfile.mkstemp() -f = os.fdopen(fd, 'w') -self.addCleanup(os.remove, path) -try: -f.write(contents) -finally: -f.close() -return path - -def test_read_trees_from_conf_ko(self): -name = self.create_file( -[foo
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 6043bed Test both BuildFarm and CachingBuildFarm. from 3de05b3 Add some more base buildfarm tests. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 6043bede719fb9eebab45f22e2fd1b51fee94981 Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 22:59:47 2010 +0100 Test both BuildFarm and CachingBuildFarm. --- Summary of changes: buildfarm/tests/test_buildfarm.py | 21 ++--- 1 files changed, 18 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/tests/test_buildfarm.py b/buildfarm/tests/test_buildfarm.py index 9132445..4cec0b7 100644 --- a/buildfarm/tests/test_buildfarm.py +++ b/buildfarm/tests/test_buildfarm.py @@ -17,6 +17,7 @@ from buildfarm import ( BuildFarm, +CachingBuildFarm, data, read_trees_from_conf, ) @@ -73,13 +74,11 @@ branch = HEAD git) -class BuildFarmTests(BuildFarmTestCase): +class BuildFarmTestBase(object): def setUp(self): -super(BuildFarmTests, self).setUp() self.write_compilers([cc]) self.write_trees({trivial: { scm: git, repo: git://foo, branch: master }}) -self.x = BuildFarm(self.path) def test_get_new_builds_empty(self): self.assertEquals([], list(self.x.get_new_builds())) @@ -93,3 +92,19 @@ class BuildFarmTests(BuildFarmTestCase): self.assertEquals(git, tree.scm) self.assertEquals(git://foo, tree.repo) self.assertEquals(master, tree.branch) + + +class BuildFarmTests(BuildFarmTestBase, BuildFarmTestCase): + +def setUp(self): +BuildFarmTestCase.setUp(self) +BuildFarmTestBase.setUp(self) +self.x = BuildFarm(self.path) + + +class CachingBuildFarmTests(BuildFarmTestBase, BuildFarmTestCase): + +def setUp(self): +BuildFarmTestCase.setUp(self) +BuildFarmTestBase.setUp(self) +self.x = CachingBuildFarm(self.path) -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via d3fe741 Test both cache and non-cache versions. from 6043bed Test both BuildFarm and CachingBuildFarm. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit d3fe741c17f8401ae5dfe1d1fcd10992405ed7e7 Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 23:19:30 2010 +0100 Test both cache and non-cache versions. --- Summary of changes: buildfarm/tests/test_data.py | 66 + 1 files changed, 46 insertions(+), 20 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index d576fb3..9a5f867 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -17,7 +17,6 @@ from cStringIO import StringIO import os -import tempfile import testtools import time import unittest @@ -34,25 +33,13 @@ class NonexistantTests(unittest.TestCase): Exception, data.BuildResultStore, somedirthatdoesn'texist, None) -class BuildResultStoreTests(BuildFarmTestCase): - -def setUp(self): -super(BuildResultStoreTests, self).setUp() - -self.x = data.CachingBuildResultStore( -os.path.join(self.path, data, oldrevs), -os.path.join(self.path, cache)) +class BuildResultStoreTestBase(object): def test_build_fname(self): self.assertEquals( self.x.build_fname(mytree, myhost, cc, 123), %s/data/oldrevs/build.mytree.myhost.cc-123 % self.path) -def test_cache_fname(self): -self.assertEquals( -self.x.cache_fname(mytree, myhost, cc, 123), -%s/cache/build.mytree.myhost.cc-123 % self.path) - def test_build_age_mtime(self): path = self.create_mock_logfile(tdb, charis, cc, 12) # Set mtime to something in the past @@ -119,6 +106,31 @@ error3) self.assertEquals(3, build.err_count()) + +class BuildResultStoreTests(BuildFarmTestCase,BuildResultStoreTestBase): + +def setUp(self): +super(BuildResultStoreTests, self).setUp() + +self.x = data.BuildResultStore( +os.path.join(self.path, data, oldrevs)) + + +class CachingBuildResultStoreTests(BuildFarmTestCase,BuildResultStoreTestBase): + +def setUp(self): +super(CachingBuildResultStoreTests, self).setUp() + +self.x = data.CachingBuildResultStore( +os.path.join(self.path, data, oldrevs), +os.path.join(self.path, cache)) + +def test_cache_fname(self): +self.assertEquals( +self.x.cache_fname(mytree, myhost, cc, 123), +%s/cache/build.mytree.myhost.cc-123 % self.path) + + class BuildStatusFromLogs(testtools.TestCase): def parse_logs(self, log, err): @@ -252,21 +264,35 @@ class BuildStatusTest(testtools.TestCase): self.assertEquals(cmp(d, e), -1) -class UploadBuildResultStoreTests(BuildFarmTestCase): +class UploadBuildResultStoreTestBase(object): + +def test_build_fname(self): +self.assertEquals( +self.x.build_fname(mytree, myhost, cc), +%s/data/upload/build.mytree.myhost.cc % self.path) + + +class UploadBuildResultStoreTests(UploadBuildResultStoreTestBase,BuildFarmTestCase): def setUp(self): super(UploadBuildResultStoreTests, self).setUp() +self.x = data.UploadBuildResultStore( +os.path.join(self.path, data, upload)) + + +class CachingUploadBuildResultStoreTests(UploadBuildResultStoreTestBase,BuildFarmTestCase): + +def setUp(self): +super(CachingUploadBuildResultStoreTests, self).setUp() + self.x = data.CachingUploadBuildResultStore( os.path.join(self.path, data, upload), os.path.join(self.path, cache)) -def test_build_fname(self): -self.assertEquals( -self.x.build_fname(mytree, myhost, cc), -%s/data/upload/build.mytree.myhost.cc % self.path) - def test_cache_fname(self): self.assertEquals( self.x.cache_fname(mytree, myhost, cc), %s/cache/build.mytree.myhost.cc % self.path) + + -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 0d80220 Add tests for BuildFarm.get_build(). from d3fe741 Test both cache and non-cache versions. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 0d802201adfe505c31eb4b32be3e3d8337d692cd Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 23:24:28 2010 +0100 Add tests for BuildFarm.get_build(). --- Summary of changes: buildfarm/tests/test_buildfarm.py | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/tests/test_buildfarm.py b/buildfarm/tests/test_buildfarm.py index 4cec0b7..86e249a 100644 --- a/buildfarm/tests/test_buildfarm.py +++ b/buildfarm/tests/test_buildfarm.py @@ -93,6 +93,24 @@ class BuildFarmTestBase(object): self.assertEquals(git://foo, tree.repo) self.assertEquals(master, tree.branch) +def test_get_build_rev(self): +path = self.create_mock_logfile(tdb, charis, cc, 12, +contents=This is what a log file looks like.) +build = self.x.get_build(tdb, charis, cc, 12) +self.assertEquals(tdb, build.tree) +self.assertEquals(charis, build.host) +self.assertEquals(cc, build.compiler) +self.assertEquals(12, build.rev) + +def test_get_build_no_rev(self): +path = self.create_mock_logfile(tdb, charis, cc, +contents=This is what a log file looks like.) +build = self.x.get_build(tdb, charis, cc) +self.assertEquals(tdb, build.tree) +self.assertEquals(charis, build.host) +self.assertEquals(cc, build.compiler) +self.assertIs(None, build.rev) + class BuildFarmTests(BuildFarmTestBase, BuildFarmTestCase): -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via ed1f580 Test upload_build. from 0d80220 Add tests for BuildFarm.get_build(). http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit ed1f580fed5b2ca31fb0d879efdd291b4859084f Author: Jelmer Vernooij jel...@samba.org Date: Fri Nov 12 00:21:28 2010 +0100 Test upload_build. --- Summary of changes: buildfarm/__init__.py|8 ++-- buildfarm/data.py| 34 +++--- buildfarm/tests/test_data.py | 15 +++ 3 files changed, 40 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index fdb197c..3bbfe4f 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -39,7 +39,11 @@ class Tree(object): def read_trees_from_conf(path): -Read trees from a configuration file. +Read trees from a configuration file. + +:param path: tree path +:return: Dictionary with trees + ret = {} cfp = ConfigParser.ConfigParser() cfp.readfp(open(path)) @@ -182,5 +186,5 @@ class CachingBuildFarm(BuildFarm): perc = super(CachingBuildFarm, self).lcov_status(tree) if not self.readonly: -util.FileSave(cachefile, ret) +util.FileSave(cachefile, perc) return perc diff --git a/buildfarm/data.py b/buildfarm/data.py index 0e09b13..26f2775 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -169,16 +169,13 @@ class Build(object): A single build of a tree on a particular host using a particular compiler. -def __init__(self, store, tree, host, compiler, rev=None): +def __init__(self, store, basename, tree, host, compiler, rev=None): self._store = store +self.basename = basename self.tree = tree self.host = host self.compiler = compiler self.rev = rev -if rev is None: -self.basename = self._store.build_fname(self.tree, self.host, self.compiler) -else: -self.basename = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) ### # the mtime age is used to determine if builds are still happening @@ -365,10 +362,11 @@ class UploadBuildResultStore(object): return False def get_build(self, tree, host, compiler): -logf = self.build_fname(tree, host, compiler) + .log +basename = self.build_fname(tree, host, compiler) +logf = %s.log % basename if not os.path.exists(logf): raise NoSuchBuildError(tree, host, compiler) -return Build(self, tree, host, compiler) +return Build(self, basename, tree, host, compiler) class CachingUploadBuildResultStore(UploadBuildResultStore): @@ -386,10 +384,11 @@ class CachingUploadBuildResultStore(UploadBuildResultStore): return os.path.join(self.cachedir, build.%s.%s.%s % (tree, host, compiler)) def get_build(self, tree, host, compiler): -logf = self.build_fname(tree, host, compiler) + .log +basename = self.build_fname(tree, host, compiler) +logf = %s.log % basename if not os.path.exists(logf): raise NoSuchBuildError(tree, host, compiler) -return CachingBuild(self, tree, host, compiler) +return CachingBuild(self, basename, tree, host, compiler) class BuildResultStore(object): @@ -403,10 +402,11 @@ class BuildResultStore(object): self.path = path def get_build(self, tree, host, compiler, rev): -logf = self.build_fname(tree, host, compiler, rev) + .log +basename = self.build_fname(tree, host, compiler, rev) +logf = %s.log % basename if not os.path.exists(logf): raise NoSuchBuildError(tree, host, compiler, rev) -return Build(self, tree, host, compiler, rev) +return Build(self, basename, tree, host, compiler, rev) def build_fname(self, tree, host, compiler, rev): get the name of the build file @@ -442,10 +442,13 @@ class BuildResultStore(object): if commit_rev is not None: rev = commit_rev +if not rev: +raise Exception(Unable to find revision in %r log % build) + new_basename = self.build_fname(build.tree, build.host, build.compiler, rev) -os.rename(build.basename+.log, new_basename+.log) +os.link(build.basename+.log, new_basename+.log) if os.path.exists(build.basename+.err): -os.rename(build.basename+.err, new_basename+.err) +os.link(build.basename+.err, new_basename+.err) # FIXME: # $st = $dbh-prepare(INSERT INTO build (tree, revision, commit_revision, host, compiler, checksum, age, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)) @@ -475,10 +478,11
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 7851c49 Split up further. via 2f489ce Split up BuildResultStore further. via 1300d88 Move more functionality to buildfarm.BuildFarm. via cea251c Remove trees from BuildResultStore. via ecd6140 Add BuildFarm object, remove compilers and host_age from BuildResultStore. via 0669b47 Fix smtplib.Connection - smtplib.SMTP. via 69c7574 Add python version of import-and-analyse.pl. from 6b3372f Remove unused variable. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 7851c49eaa94c31e8e89cef7d5551722bbb4e451 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 09:31:49 2010 +0100 Split up further. commit 2f489ce85384cc5a81237187db1f39dac12d771b Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 09:26:07 2010 +0100 Split up BuildResultStore further. commit 1300d8845dd004d73d8c0e2cc780093ba442b8c6 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 08:32:38 2010 +0100 Move more functionality to buildfarm.BuildFarm. commit cea251c95ae5c166f6b40da896f3b395d1d3ca6a Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 08:23:49 2010 +0100 Remove trees from BuildResultStore. commit ecd61407c8e7c6e59a18c810a3038493f54e37e9 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 08:19:01 2010 +0100 Add BuildFarm object, remove compilers and host_age from BuildResultStore. commit 0669b471176c6204afa1cb75b37e7c7d314f690e Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 08:09:05 2010 +0100 Fix smtplib.Connection - smtplib.SMTP. commit 69c7574774c799c6a2ee3c11b6dd51640e1b1eb7 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 08:08:48 2010 +0100 Add python version of import-and-analyse.pl. --- Summary of changes: admin.py |6 +- buildfarm/__init__.py| 107 - buildfarm/data.py| 274 +++--- buildfarm/tests/__init__.py | 69 ++- buildfarm/tests/test_data.py | 122 +++ import-and-analyse.py| 181 mail-dead-hosts.py |8 +- web/build.py | 17 ++-- 8 files changed, 562 insertions(+), 222 deletions(-) create mode 100644 import-and-analyse.py Changeset truncated at 500 lines: diff --git a/admin.py b/admin.py index d94b572..909d303 100755 --- a/admin.py +++ b/admin.py @@ -19,7 +19,7 @@ from buildfarm import ( hostdb, -open_hostdb, +BuildFarm, ) import commands import os @@ -28,7 +28,9 @@ import sys import time from email.MIMEText import MIMEText -db = open_hostdb() +buildfarm = BuildFarm() + +db = buildfarm.hostdb dry_run = False diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index e133cda..30c6005 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -17,9 +17,108 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +import ConfigParser import os -def open_hostdb(): -from buildfarm import hostdb -return hostdb.HostDatabase( -os.path.join(os.path.dirname(__file__), .., hostdb.sqlite)) + +class Tree(object): +A tree to build. + +def __init__(self, name, scm, repo, branch, subdir=, srcdir=): +self.name = name +self.repo = repo +self.scm = scm +self.branch = branch +self.subdir = subdir +self.srcdir = srcdir +self.scm = scm + +def __repr__(self): +return %s %r % (self.__class__.__name__, self.name) + + +def read_trees_from_conf(path): +Read trees from a configuration file. +ret = {} +cfp = ConfigParser.ConfigParser() +cfp.readfp(open(path)) +for s in cfp.sections(): +ret[s] = Tree(name=s, **dict(cfp.items(s))) +return ret + + +def lcov_extract_percentage(text): +m = re.search('\td class=headerItem.*?\Code\nbsp\;covered\:\\/td\.*?\n.*?\td class=headerValue.*?\([0-9.]+) \%', text) +if m: +return m.group(1) +else: +return None + + +class BuildFarm(object): + +LCOVHOST = magni +OLDAGE = 60*60*4, +DEADAGE = 60*60*24*4 + +def __init__(self, path=None): +if path is None: +path = os.path.abspath(os.path.join(os.path.dirname(__file__), ..)) +self.path = path +self.webdir = os.path.join(self.path, web) +if not os.path.isdir(path): +raise Exception(web directory %s does not exist % self.webdir) +self.trees = read_trees_from_conf(os.path.join(self.webdir, trees.conf)) +self.builds = self._open_build_results() +self.hostdb = self._open_hostdb() +self.compilers = self._load_compilers() +self.lcovdir
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 211abe8 More improvements to import-and-analyse. from ee296a4 Simplify some code. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 211abe8c5db88a77017077495fd37f3a7d7cf019 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 11:23:57 2010 +0100 More improvements to import-and-analyse. --- Summary of changes: buildfarm/__init__.py |4 +- buildfarm/data.py | 96 ++--- buildfarm/util.py |3 +- import-and-analyse.py | 18 - 4 files changed, 38 insertions(+), 83 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index b12fb7b..2370940 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -71,7 +71,7 @@ class BuildFarm(object): raise Exception(web directory %s does not exist % self.webdir) self.trees = read_trees_from_conf(os.path.join(self.webdir, trees.conf)) self.builds = self._open_build_results() -self.upload_builds = self._open_upload_builds_results() +self.upload_builds = self._open_upload_build_results() self.hostdb = self._open_hostdb() self.compilers = self._load_compilers() self.lcovdir = os.path.join(self.path, lcov/data) @@ -131,7 +131,7 @@ class BuildFarm(object): def get_new_builds(self): from buildfarm import data -for host in self.hostsdb.hosts(): +for host in self.hostdb.hosts(): for tree in self.trees: for compiler in self.compilers: # By building the log file name this way, using only the list of diff --git a/buildfarm/data.py b/buildfarm/data.py index 7062431..493badb 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -175,6 +175,10 @@ class Build(object): self.host = host self.compiler = compiler self.rev = rev +if rev is None: +self.basename = self._store.build_fname(self.tree, self.host, self.compiler) +else: +self.basename = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) ### # the mtime age is used to determine if builds are still happening @@ -183,26 +187,22 @@ class Build(object): def age_mtime(self): get the age of build from mtime -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) - -st = os.stat(%s.log % file) +st = os.stat(%s.log % self.basename) return time.time() - st.st_mtime def age_ctime(self): get the age of build from ctime -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) - -st = os.stat(%s.log % file) +st = os.stat(%s.log % self.basename) return time.time() - st.st_ctime def read_log(self): read full log file -return open(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.log, r) +return open(self.basename+.log, r) def read_err(self): read full err file try: -return open(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.err, 'r') +return open(self.basename+.err, 'r') except IOError: # No such file return StringIO() @@ -232,7 +232,7 @@ class Build(object): timestamp = None f = self.read_log() try: -for l in f.readlines(): +for l in f: if l.startswith(BUILD COMMIT REVISION: ): commit_revid = l.split(:, 1)[1].strip() elif l.startswith(BUILD REVISION: ): @@ -270,9 +270,8 @@ class CachingBuild(Build): to calculate. def revision_details(self): -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) cachef = self._store.cache_fname(self.tree, self.host, self.compiler, self.rev) -st1 = os.stat(%s.log % file) +st1 = os.stat(%s.log % self.basename) try: st2 = os.stat(%s.revision % cachef) @@ -297,9 +296,8 @@ class CachingBuild(Build): return (revid, commit_revid, timestamp) def err_count(self): -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) cachef = self._store.cache_fname(self.tree, self.host, self.compiler, self.rev) -st1 = os.stat(%s.err % file) +st1 = os.stat(%s.err % self.basename) try: st2 = os.stat(%s.errcount % cachef) @@ -318,10 +316,9 @@ class CachingBuild(Build): return ret def status(self): -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev
[SCM] build.samba.org - branch master updated
The branch, master has been updated via ee296a4 Simplify some code. via 1459e8f Simplify new build iteration. via 5bd8f3b More work on import and analyse. from 7851c49 Split up further. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit ee296a4ceeb7338d3f5d572f2f591ba4ab3a0f07 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 10:05:34 2010 +0100 Simplify some code. commit 1459e8f65ea41886db18c6387e7b4968f3a2723b Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 09:44:57 2010 +0100 Simplify new build iteration. commit 5bd8f3b6c81edcc765b0c57c460a94c7bed6ebde Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 09:38:26 2010 +0100 More work on import and analyse. --- Summary of changes: buildfarm/__init__.py| 19 buildfarm/data.py| 14 ++- buildfarm/tests/test_util.py |8 --- buildfarm/util.py|5 import-and-analyse.py| 48 ++ 5 files changed, 38 insertions(+), 56 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 30c6005..b12fb7b 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -19,6 +19,7 @@ import ConfigParser import os +import re class Tree(object): @@ -70,6 +71,7 @@ class BuildFarm(object): raise Exception(web directory %s does not exist % self.webdir) self.trees = read_trees_from_conf(os.path.join(self.webdir, trees.conf)) self.builds = self._open_build_results() +self.upload_builds = self._open_upload_builds_results() self.hostdb = self._open_hostdb() self.compilers = self._load_compilers() self.lcovdir = os.path.join(self.path, lcov/data) @@ -81,6 +83,10 @@ class BuildFarm(object): from buildfarm import data return data.BuildResultStore(os.path.join(self.path, data, oldrevs)) +def _open_upload_build_results(self): +from buildfarm import data +return data.UploadBuildResultStore(os.path.join(self.path, data, upload)) + def _open_hostdb(self): from buildfarm import hostdb return hostdb.HostDatabase( @@ -122,3 +128,16 @@ class BuildFarm(object): if self.readonly: util.FileSave(cachefile, ret) return perc + +def get_new_builds(self): +from buildfarm import data +for host in self.hostsdb.hosts(): +for tree in self.trees: +for compiler in self.compilers: +# By building the log file name this way, using only the list of +# hosts, trees and compilers as input, we ensure we +# control the inputs +try: +yield self.upload_builds.get_build(host, tree, compiler) +except data.NoSuchBuildError: +continue diff --git a/buildfarm/data.py b/buildfarm/data.py index 7ff8c92..7062431 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -226,12 +226,11 @@ class Build(object): :return: Tuple with revision id and timestamp (if available) -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) revid = None commit_revid = None timestamp = None -f = open(%s.log % file, 'r') +f = self.read_log() try: for l in f.readlines(): if l.startswith(BUILD COMMIT REVISION: ): @@ -262,15 +261,8 @@ class Build(object): def err_count(self): get status of build -file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) - -try: -err = util.FileLoad(%s.err % file) -except OSError: -# File does not exist -return 0 - -return util.count_lines(err) +file = self.read_err() +return len(file.readlines()) class CachingBuild(Build): diff --git a/buildfarm/tests/test_util.py b/buildfarm/tests/test_util.py index 3a1d5a4..79a311d 100755 --- a/buildfarm/tests/test_util.py +++ b/buildfarm/tests/test_util.py @@ -22,14 +22,6 @@ import unittest from buildfarm import util -class CountLinesTests(unittest.TestCase): - -def test_simple(self): -self.assertEquals(2, util.count_lines(foo\nbar)) -self.assertEquals(1, util.count_lines(bar)) -self.assertEquals(1, util.count_lines()) - - class ChangeExtensionTests(unittest.TestCase): def test_simple(self): diff --git a/buildfarm/util.py b/buildfarm/util.py index 83346c1..60b263e 100644 --- a/buildfarm/util.py +++ b/buildfarm/util.py @@ -77,11 +77,6 @@ def ChangeExtension(fname, ext): return %s.%s % (base, ext
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 4db119b We no longer have CVS-based projects, and should not introduce any newer; remove cvslog.pl. from 211abe8 More improvements to import-and-analyse. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 4db119b01c2f86fbff7829d40c2ed45309f2c6a9 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 11:26:30 2010 +0100 We no longer have CVS-based projects, and should not introduce any newer; remove cvslog.pl. --- Summary of changes: cvslog.pl | 282 - 1 files changed, 0 insertions(+), 282 deletions(-) delete mode 100755 cvslog.pl Changeset truncated at 500 lines: diff --git a/cvslog.pl b/cvslog.pl deleted file mode 100755 index 11d559e..000 --- a/cvslog.pl +++ /dev/null @@ -1,282 +0,0 @@ -#!/usr/bin/perl -w -# -# Extract information about recent CVS commits -# -# tri...@samba.org, April 2001 - -use strict; -use util; -use POSIX; -use Data::Dumper; -use File::stat; -use Date::Parse; - - -# parse a CVS date -sub cvs_parse_date($) -{ -my $s = shift; - -if (! ($s =~ /@/)) { - return str2time($s); -} - -if ($s =~ /(.*) (.*) ([0-9]+), ([0-9]+) @ ([0-9]+):([0-9]+)/) { - my $day = $1; - my $month = $2; - my $mday = $3; - my $year = $4; - my $hour = $5; - my $min = $6; - my (%months) = ('January' = 1, 'February' = 2, 'March' = 3, 'April' = 4, - 'May' = 5, 'June' = 6, 'July' = 7, 'August' = 8, 'September' = 9, - 'October' = 10, 'November' = 11, 'December' = 12); - my $t = mktime(0, $min, $hour, $mday, $months{$month}-1, $year-1900); - return $t; -} - -print ERROR: bad date format $s\n; -return 0; -} - - - -# push an entry onto the array - -# FIXME: This incorrectly handles multiple commits with the same log -# message. The cvslog output only shows the revisions for the last -# commit, but actually we want to either not coalesce, or show the -# overall delta. - -sub push_entry($) -{ - my $entry = shift; - my $log = shift; - my $days = shift; - my $tree = shift; - my $tag = shift; - my $lastentry = $log-[$#{$log}]; - - if ($lastentry-{DATE} $lastentry-{AUTHOR} - ($lastentry-{DATE} $entry-{DATE}-600) - ($lastentry-{AUTHOR} eq $entry-{AUTHOR}) - ((!$lastentry-{TAG} !$entry-{TAG}) || - ($lastentry-{TAG} eq $entry-{TAG})) - ((!$lastentry-{MESSAGE} !$entry-{MESSAGE}) || - ($lastentry-{MESSAGE} eq $entry-{MESSAGE}))) { - -if (exists $lastentry-{FILES}) { - $lastentry-{FILES} .= $entry-{FILES}; -} else { - $lastentry-{FILES} = $entry-{FILES}; -} - -if (exists $lastentry-{ADDED}) { - $lastentry-{ADDED} .= $entry-{ADDED}; -} else { - $lastentry-{ADDED} = $entry-{ADDED}; -} - -if (exists $lastentry-{REMOVED}) { - $lastentry-{REMOVED} .= $entry-{REMOVED}; -} else { - $lastentry-{REMOVED} = $entry-{REMOVED}; -} - -if (exists $lastentry-{REVISIONS}) { - $lastentry-{REVISIONS} = {%{$lastentry-{REVISIONS}},%{$entry-{REVISIONS}}}; -} else { - $lastentry-{REVISIONS} = $entry-{REVISIONS}; -} - } else { -if (($entry-{DATE} time() - $days*24*60*60) - ((!$entry-{TAG} !$tag) || -($entry-{TAG} eq $tag)) - ($entry-{TREE} eq $tree)) { - push(@{$log}, $entry); -} - } - return $log; -} - - -# return an array of logfile entries given a cvs log file. -# Only return entries newer than $days old -sub cvs_parse() -{ -my $file = shift; -my $days = shift; -my $tree = shift; -my $tag = shift; -my $log; -my $entry; - -open(FILE, $file); -while (FILE) { - my $line = $_; - - # ignore separator lines - if ($line =~ /^[*]+/) { next; } - - if ($line =~ /^Date:\s*(.*)/) { - if ($entry-{DATE}) { - $log = push_entry($entry, $log, $days, $tree, $tag); - } - $entry = {}; - $entry-{DATE} = cvs_parse_date($1); - $entry-{DIR} = ; - next; - } - - if ($line =~ /^Author:\s*(.*)/) { - $entry-{AUTHOR} = $1; - next; - } - - if ($line =~ /^Update of (.*)/) { - $entry-{TREE} = $1; - if ($entry-{TREE} =~ /\/(data|home)\/cvs\/([^\/]*)\/?(.*)/) { - $entry-{TREE} = $2; - $entry-{DIR} = $3; - if ($entry-{DIR}) { $entry-{DIR} .= /; } - } elsif ($entry-{TREE} =~ /\/home\/tridge\/cvstest\/([^\/]*)\/?(.*)/) { - $entry-{TREE} = $1; - $entry-{DIR} = $2; - if ($entry-{DIR
[SCM] build.samba.org - branch master updated
The branch, master has been updated via e7f5f8b Move lcov cache onto BuildFarm, simplify get_build. from a6951b8 desactivate history for the moment (it's broken) http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit e7f5f8bd5485ef4b1a742b6b64aa0cb49008ce01 Author: Jelmer Vernooij jel...@samba.org Date: Thu Nov 11 01:50:54 2010 +0100 Move lcov cache onto BuildFarm, simplify get_build. --- Summary of changes: buildfarm/__init__.py | 20 +--- buildfarm/data.py |8 2 files changed, 5 insertions(+), 23 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 118a729..85690e3 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -66,6 +66,7 @@ class BuildFarm(object): if path is None: path = os.path.abspath(os.path.join(os.path.dirname(__file__), ..)) self.path = path +self.cachedir = os.path.join(self.path, cache) self.webdir = os.path.join(self.path, web) if not os.path.isdir(path): raise Exception(web directory %s does not exist % self.webdir) @@ -99,7 +100,8 @@ class BuildFarm(object): def lcov_status(self, tree): get status of build from buildfarm import data, util -cachefile = self.builds.get_lcov_cached_status(self.LCOVHOST, tree) +cachefile = os.path.join(self.cachedir, lcov.%s.%s.status % ( +self.LCOVHOST, tree)) file = os.path.join(self.lcovdir, self.LCOVHOST, tree, index.html) try: st1 = os.stat(file) @@ -130,21 +132,9 @@ class BuildFarm(object): def get_build(self, tree, host, compiler, rev=None): if rev: -if host in self.hostdb.hosts() and\ -tree in self.trees and\ -compiler in self.compilers: -return self.builds.get_build(tree, host, compiler) -else: -from buildfarm import data -raise data.NoSuchBuildError(tree, host, compiler) +return self.builds.get_build(tree, host, compiler, rev) else: -if host in [h.name for h in self.hostdb.hosts()] and\ -tree in self.trees and\ -compiler in self.compilers: -return self.upload_builds.get_build(tree, host, compiler) -else: -from buildfarm import data -raise data.NoSuchBuildError(tree, host, compiler) +return self.upload_builds.get_build(tree, host, compiler) def get_new_builds(self): from buildfarm import data diff --git a/buildfarm/data.py b/buildfarm/data.py index f709422..9f7708c 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -396,9 +396,6 @@ class BuildResultStore(object): self.path = path -def get_lcov_cached_status(self, host, tree): -return None - def get_build(self, tree, host, compiler, rev): logf = self.build_fname(tree, host, compiler, rev) + .log if not os.path.exists(logf): @@ -479,8 +476,3 @@ class CachingBuildResultStore(BuildResultStore): def cache_fname(self, tree, host, compiler, rev): return os.path.join(self.cachedir, build.%s.%s.%s-%s % (tree, host, compiler, rev)) - -def get_lcov_cached_status(self, host, tree): -return os.path.join(self.cachedir, lcov.%s.%s.status % (host, tree)) - - -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 07eec5a Parse log line-by-line. via bd94958 Simplify log parsing a bit. from 3da72d3 Remove svn/cvs support. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 07eec5adf22d08a0287dde5a0eb1907845adcf43 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 9 09:13:42 2010 +0100 Parse log line-by-line. commit bd94958b2e4741c84e21503c11406009be72c0c1 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 9 08:37:48 2010 +0100 Simplify log parsing a bit. --- Summary of changes: buildfarm/data.py| 107 +++--- buildfarm/tests/test_data.py | 29 +++- 2 files changed, 66 insertions(+), 70 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 0b30cdc..15afd31 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -33,9 +33,12 @@ import util class BuildStatus(object): -def __init__(self, stages, other_failures): +def __init__(self, stages=None, other_failures=None): self.stages = stages -self.other_failures = other_failures +if other_failures is not None: +self.other_failures = other_failures +else: +self.other_failures = set() def __str__(self): return repr((self.stages, self.other_failures)) @@ -48,66 +51,54 @@ def check_dir_exists(kind, path): def build_status_from_logs(log, err): get status of build -log = log.read() -m = re.search(TEST STATUS:(\s*\d+), log) -other_failures = set() -if m: -tstatus = int(m.group(1).strip()) -else: -m = re.search(ACTION (PASSED|FAILED): test, log) -if m: -test_failures = len(re.findall(testsuite-(failure|error): , log)) -test_successes = len(re.findall(testsuite-success: , log)) -if test_successes 0: -tstatus = test_failures -else: -tstatus = 255 -if m.group(1) == FAILED and tstatus == 0: -tstatus = -1 -other_failures.add(make test error) -else: -tstatus = None - -m = re.search(INSTALL STATUS:(\s*\d+), log) -if m: -istatus = int(m.group(1).strip()) -else: -istatus = None - -m = re.search(BUILD STATUS:(\s*\d+), log) -if m: -bstatus = int(m.group(1).strip()) -else: -bstatus = None - -m = re.search(CONFIGURE STATUS:(\s*\d+), log) -if m: -cstatus = int(m.group(1).strip()) -else: -cstatus = None - -m = re.search((PANIC|INTERNAL ERROR):.*, log) -if m: -other_failures.add(panic) - -if No space left on device in log: -other_failures.add(disk full) - -if maximum runtime exceeded in log: -other_failures.add(timeout) +test_failures = 0 +test_successes = 0 +ret = BuildStatus() -stages = (cstatus, bstatus, istatus, tstatus) +stages = [] -m = re.search(CC_CHECKER STATUS:(\s*\d+), log) -if m: -stages = stages + (int(m.group(1).strip()),) - -# Scan err file for specific +for l in log: +m = re.match(^([A-Z_]+) STATUS:(\s*\d+)$, l) +if m: +stages.append((m.group(1), int(m.group(2).strip( +continue +if l.startswith(No space left on device): +ret.other_failures.add(disk full) +continue +if l.startswith(maximum runtime exceeded): +ret.other_failures.add(timeout) +continue +m = re.match(^(PANIC|INTERNAL ERROR):.*$, l) +if m: +ret.other_failures.add(panic) +continue +if l.startswith(testsuite-failure: ) or l.startswith(testsuite-error: ): +test_failures += 1 +continue +if l.startswith(testsuite-success: ): +test_successes += 1 +continue + +# Scan err file for specific errors for l in err: if No space left on device in l: -other_failures.add(disk full) - -return BuildStatus(stages, other_failures) +ret.other_failures.add(disk full) + +stage_results = dict(stages) +def map_stage(name, result): +if name != TEST: +return result +# TEST is special +if test_successes + test_failures == 0: +# No granular test output +return result +if result == 0 and test_failures == 0: +ret.other_failures.add(inconsistent test result) +return -1 +return test_failures + +ret.stages = tuple([map_stage(k, v) for k, v in stages]) +return ret def lcov_extract_percentage(text): diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 5b5ab12 include stage name in stages list. from f400877 Cast unicode strings to utf-8 strings http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 5b5ab12f09c68d2a2ece7eaea3cb30b2ede8cbd3 Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 9 16:35:20 2010 +0100 include stage name in stages list. --- Summary of changes: buildfarm/data.py| 31 --- buildfarm/tests/test_data.py | 17 +++-- web/build.py |2 +- 3 files changed, 36 insertions(+), 14 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 15afd31..80a633c 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -34,12 +34,29 @@ import util class BuildStatus(object): def __init__(self, stages=None, other_failures=None): -self.stages = stages +if stages is not None: +self.stages = stages +else: +self.stages = [] if other_failures is not None: self.other_failures = other_failures else: self.other_failures = set() +def broken_host(self): +if disk full in self.other_failures: +return True +return False + +def _status_tuple(self): +return [v for (k, v) in self.stages] + +def regressed_since(self, other): +Check if this build has regressed since another build. +if disk full in self.other_failures: +return False +return cmp(self._status_tuple(), other._status_tuple()) + def __str__(self): return repr((self.stages, self.other_failures)) @@ -87,17 +104,17 @@ def build_status_from_logs(log, err): stage_results = dict(stages) def map_stage(name, result): if name != TEST: -return result +return (name, result) # TEST is special if test_successes + test_failures == 0: # No granular test output -return result +return (TEST, result) if result == 0 and test_failures == 0: ret.other_failures.add(inconsistent test result) -return -1 -return test_failures +return (TEST, -1) +return (TEST, test_failures) -ret.stages = tuple([map_stage(k, v) for k, v in stages]) +ret.stages = [map_stage(name, result) for (name, result) in stages] return ret @@ -312,7 +329,6 @@ class CachingBuild(Build): return ret - def read_trees_from_conf(path): Read trees from a configuration file. ret = {} @@ -442,6 +458,7 @@ class BuildResultStore(object): def host_age(self, host): get the overall age of a host +# FIXME: Turn this into a simple SQL query, or use something in hostdb ? ret = None for compiler in self.compilers: for tree in self.trees: diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 6b776ca..66e4f06 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -184,7 +184,7 @@ class BuildStatusFromLogs(testtools.TestCase): def test_nothing(self): s = self.parse_logs(, ) -self.assertEquals((), s.stages) +self.assertEquals([], s.stages) self.assertEquals(set(), s.other_failures) def test_disk_full(self): @@ -205,14 +205,16 @@ class BuildStatusFromLogs(testtools.TestCase): TEST STATUS:1 res = self.parse_logs(log, ) -self.assertEquals(res.stages, (1,)) +self.assertEquals(res.stages, [ +(TEST, 1)]) def test_failed_test_whitespace(self): log = TEST STATUS: 1 res = self.parse_logs(log, ) -self.assertEquals(res.stages, (1,)) +self.assertEquals(res.stages, +[(TEST, 1)]) def test_failed_test_noise(self): log = @@ -221,7 +223,8 @@ TEST STATUS: 1 CC_CHECKER STATUS: 2 res = self.parse_logs(log, ) -self.assertEquals(res.stages, (2,1,2)) +self.assertEquals(res.stages, +[(CONFIGURE, 2), (TEST, 1), (CC_CHECKER, 2)]) def test_no_test_output(self): log = @@ -230,7 +233,8 @@ TEST STATUS: 0 CC_CHECKER STATUS: 2 res = self.parse_logs(log, ) -self.assertEquals(res.stages, (2, 0, 2)) +self.assertEquals(res.stages, +[(CONFIGURE, 2), (TEST, 0), (CC_CHECKER, 2)]) def test_granular_test(self): log = @@ -243,5 +247,6 @@ TEST STATUS: 1 CC_CHECKER STATUS: 2 res = self.parse_logs(log, ) -self.assertEquals(res.stages, (2, 3, 2)) +self.assertEquals(res.stages, +[(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 2)]) diff --git a/web/build.py b/web
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 9b5d8e0 Cope with intermediate errors. via d08baa5 Cope with other_failures being the same. via 794ca6c Use standard infrastructure for cmp. from 1866e85 Return to the current directory after dealing with git revision calculation http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 9b5d8e01a53fcf035b153b05b06fb364e33c4822 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 06:57:53 2010 +0100 Cope with intermediate errors. commit d08baa5a63fbb39346b1decacb5aaabdc5ee5adb Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 06:41:33 2010 +0100 Cope with other_failures being the same. commit 794ca6c26b0070b0caf6e6181e1c1cfa084fa1ff Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 06:23:18 2010 +0100 Use standard infrastructure for cmp. --- Summary of changes: buildfarm/data.py| 23 - buildfarm/tests/test_data.py | 44 - 2 files changed, 39 insertions(+), 28 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index ffe4d64..8b73ee9 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -57,28 +57,23 @@ class BuildStatus(object): return False return cmp(self._status_tuple(), other._status_tuple()) -def cmp(a, b): - -#Give more importance to other failures -if len(b.other_failures): +def __cmp__(self, other): +other_extra = other.other_failures - self.other_failures +self_extra = self.other_failures - other.other_failures +# Give more importance to other failures +if other_extra: return 1 -if len(a.other_failures): +if self_extra: return -1 -la = len(a.stages) -lb = len(b.stages) +la = len(self.stages) +lb = len(other.stages) if la lb: return 1 elif lb la: return -1 else: -if la == 0: -return 0 - -sa = a.stages[-1] -sb = b.stages[-1] - -return cmp(sb[1], sa[1]) +return cmp(other.stages, self.stages) def __str__(self): return repr((self.stages, self.other_failures)) diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index aff868a..e4ebb54 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -257,38 +257,54 @@ class BuildStatusTest(testtools.TestCase): a = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 2)]) b = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 2)]) -self.assertEquals(a.cmp(b), 0) +self.assertEquals(cmp(a, b), 0) -self.assertEquals(data.BuildStatus().cmp(data.BuildStatus()), 0) +def test_cmp_empty(self): +self.assertEquals(cmp(data.BuildStatus(), data.BuildStatus()), 0) + +def test_cmp_other_failures(self): +self.assertEquals(cmp( +data.BuildStatus((), set([foo])), data.BuildStatus((), set([foo]))), +0) + +def test_cmp_intermediate_errors(self): +a = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 3)]) +b = data.BuildStatus([(CONFIGURE, 2), (TEST, 7), (CC_CHECKER, 3)]) +self.assertEquals(cmp(a, b), 1) def test_cmp_bigger(self): a = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 3)]) b = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 2)]) c = data.BuildStatus([(CONFIGURE, 2), (TEST, 3)]) -d = data.BuildStatus([], (super error)) -e = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 1)], (super error)) +d = data.BuildStatus([], set([super error])) +e = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 1)], set([super error])) # less stage means smaller, more error/higher error code means smaller as well -self.assertEquals(b.cmp(a), 1) +self.assertEquals(cmp(b, a), 1) -self.assertEquals(a.cmp(c), 1) +self.assertEquals(cmp(a, c), 1) -self.assertEquals(a.cmp(d), 1) +self.assertEquals(cmp(a, d), 1) -self.assertEquals(b.cmp(e), 1) +self.assertEquals(cmp(b, e), 1) def test_cmp_smaller(self): a = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 2)]) b = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 1)]) c = data.BuildStatus([(CONFIGURE, 2), (TEST, 3)]) -d = data.BuildStatus([], (super error)) -e = data.BuildStatus([(CONFIGURE, 2), (TEST, 3), (CC_CHECKER, 1)], (super error)) +d = data.BuildStatus([], set([super error])) +e
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 6b3372f Remove unused variable. from 9b5d8e0 Cope with intermediate errors. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 6b3372f19295976d6293e74475a07e095977a003 Author: Jelmer Vernooij jel...@samba.org Date: Wed Nov 10 06:58:47 2010 +0100 Remove unused variable. --- Summary of changes: buildfarm/data.py |1 - 1 files changed, 0 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 8b73ee9..2d03f2c 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -130,7 +130,6 @@ def build_status_from_logs(log, err): if No space left on device in l: ret.other_failures.add(disk full) -stage_results = dict(stages) def map_stage(name, result): if name != TEST: return (name, result) -- build.samba.org
Re: [SCM] Samba Shared Repository - branch master updated
Hi Tridge, On Mon, 2010-11-08 at 06:29 +0100, Andrew Tridgell wrote: - Log - commit 7bd5d402081bd7cd4cfeb2641bf011ad68be6443 Author: Andrew Tridgell tri...@samba.org Date: Mon Nov 8 15:46:09 2010 +1100 s4-ldb: don't give an error if a module is already registered this can happen when both the build and install paths are used to load ldb modules Autobuild-User: Andrew Tridgell tri...@samba.org Autobuild-Date: Mon Nov 8 05:28:14 UTC 2010 on sn-devel-104 If there are two modules available and since we can only use one, how do we know we pick the right one? Would it perhaps make sense to warn (rather than error out) if a module was already loaded? I'm also curious why this is an issue in this particular situation, why are install path modules being loaded at all? Cheers, Jelmer signature.asc Description: This is a digitally signed message part
[SCM] build.samba.org - branch master updated
The branch, master has been updated via fde3b84 Add convenience function for opening host database. from d520eea Add debug http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit fde3b8486ac056ec125e4ce3e33d882aa6401f32 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 8 08:52:54 2010 +0100 Add convenience function for opening host database. --- Summary of changes: admin.py |7 +-- buildfarm/__init__.py | 24 mail-dead-hosts.py|8 +--- web/build.py |3 ++- 4 files changed, 36 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/admin.py b/admin.py index 731876c..d94b572 100755 --- a/admin.py +++ b/admin.py @@ -17,7 +17,10 @@ # along with this program. If not, see http://www.gnu.org/licenses/. # -from buildfarm import hostdb +from buildfarm import ( +hostdb, +open_hostdb, +) import commands import os import smtplib @@ -25,7 +28,7 @@ import sys import time from email.MIMEText import MIMEText -db = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), hostdb.sqlite)) +db = open_hostdb() dry_run = False diff --git a/buildfarm/__init__.py b/buildfarm/__init__.py index 8b13789..e133cda 100644 --- a/buildfarm/__init__.py +++ b/buildfarm/__init__.py @@ -1 +1,25 @@ +#!/usr/bin/python +# Simple database query script for the buildfarm +# +# Copyright (C) Jelmer Vernooij jel...@samba.org2010 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +import os + +def open_hostdb(): +from buildfarm import hostdb +return hostdb.HostDatabase( +os.path.join(os.path.dirname(__file__), .., hostdb.sqlite)) diff --git a/mail-dead-hosts.py b/mail-dead-hosts.py index ca42a3b..725baa3 100755 --- a/mail-dead-hosts.py +++ b/mail-dead-hosts.py @@ -17,13 +17,15 @@ # along with this program. If not, see http://www.gnu.org/licenses/. # -from buildfarm import hostdb +from buildfarm import ( +hostdb, +open_hostdb, +) import smtplib from email.MIMEText import MIMEText -import os import time -db = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), hostdb.sqlite)) +db = open_hostdb() dry_run = False hosts = db.dead_hosts(7 * 86400) diff --git a/web/build.py b/web/build.py index 93c6086..b63061b 100755 --- a/web/build.py +++ b/web/build.py @@ -33,6 +33,7 @@ from buildfarm import ( data, history, hostdb, +open_hostdb, util, ) @@ -47,7 +48,7 @@ basedir = os.path.abspath(os.path.join(webdir, ..)) db = data.BuildResultStore(basedir) history = history.History(db) -hostsdb = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), .., hostdb.sqlite)) +hostsdb = open_hostdb() compilers = db.compilers hosts = dict([(host.name, host) for host in hostsdb.hosts()]) -- build.samba.org
Re: [SCM] Samba Shared Repository - branch master updated
On Mon, 2010-11-08 at 12:22 +0100, Matthias Dieter Wallnöfer wrote: @@ -1441,7 +1442,13 @@ static int py_ldb_contains(PyLdbObject *self, PyObject *obj) talloc_free(result); - return count; + if (count == 1) { + return 1; + } else if (count == 0) { + return 0; + } + + return -1; } static PySequenceMethods py_ldb_seq = { ^^ This is wrong. This means we'll not set an exception and return -1 if count is more than one. As I've said earlier I think the risk of these fixes is higher than the (purely theoretical) gain. Cheers, Jelmer signature.asc Description: This is a digitally signed message part
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 8fa1f09 Simplify build_status() code. Return all found revisions in revision_details(). from 0367b80 Force the string conversion to avoid write() argument must be string error http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 8fa1f097b77493aaefb6e792f5ab97f666c5badc Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 8 22:57:02 2010 +0100 Simplify build_status() code. Return all found revisions in revision_details(). --- Summary of changes: buildfarm/data.py| 24 ++-- buildfarm/tests/test_data.py |4 ++-- web/build.py | 21 - 3 files changed, 28 insertions(+), 21 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index d5e936a..5fe1fea 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -196,20 +196,21 @@ class Build(object): file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) revid = None +commit_revid = None timestamp = None f = open(%s.log % file, 'r') try: for l in f.readlines(): if l.startswith(BUILD COMMIT REVISION: ): -revid = l.split(:, 1)[1].strip() -elif l.startswith(BUILD REVISION: ) and not revid: +commit_revid = l.split(:, 1)[1].strip() +elif l.startswith(BUILD REVISION: ): revid = l.split(:, 1)[1].strip() elif l.startswith(BUILD COMMIT TIME): timestamp = l.split(:, 1)[1].strip() finally: f.close() -return (revid, timestamp) +return (revid, commit_revid, timestamp) def status(self): get status of build @@ -261,15 +262,18 @@ class CachingBuild(Build): # the ctime/mtime asymmetry is needed so we don't get fooled by # the mtime update from rsync if st2 and st1.st_ctime = st2.st_mtime: -(revid, timestamp) = util.FileLoad(%s.revision % cachef).split(:, 1) +(revid, commit_revid, timestamp) = util.FileLoad(%s.revision % cachef).split(:, 2) if timestamp == : -return (revid, None) -else: -return (revid, timestamp) -(revid, timestamp) = super(CachingBuild, self).revision_details() +timestamp = None +if revid == : +revid = None +if commit_revid == : +commit_revid = None +return (revid, commit_revid, timestamp) +(revid, commit_revid, timestamp) = super(CachingBuild, self).revision_details() if not self._store.readonly: -util.FileSave(%s.revision % cachef, %s:%s % (revid, timestamp or )) -return (revid, timestamp) +util.FileSave(%s.revision % cachef, %s:%s:%s % (revid, commit_revid or , timestamp or )) +return (revid, commit_revid, timestamp) def err_count(self): file = self._store.build_fname(self.tree, self.host, self.compiler, self.rev) diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 3043b4c..6184a64 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -151,7 +151,7 @@ BUILD REVISION: 42 BUILD COMMIT TIME: 3 August 2010 ) build = self.x.get_build(tdb, charis, cc) -self.assertEquals((43, 3 August 2010), build.revision_details()) +self.assertEquals((42, 43, 3 August 2010), build.revision_details()) def test_revision_details_no_timestamp(self): self.create_mock_logfile(tdb, charis, cc, contents= @@ -160,7 +160,7 @@ BUILD REVISION: 42 BLA ) build = self.x.get_build(tdb, charis, cc) -self.assertEquals((43, None), build.revision_details()) +self.assertEquals((42, 43, None), build.revision_details()) def test_err_count(self): self.create_mock_logfile(tdb, charis, cc) diff --git a/web/build.py b/web/build.py index 8f8a293..48239aa 100755 --- a/web/build.py +++ b/web/build.py @@ -112,11 +112,10 @@ def html_build_status(status): return bstatus + ostatus -def build_status(myself, tree, host, compiler, rev=None): -build = db.get_build(tree, host, compiler, rev) +def build_status_html(myself, build): rawstatus = build.status() status = html_build_status(rawstatus) -return build_link(myself, tree, host, compiler, rev, status) +return build_link(myself, build.tree, build.host, build.compiler, build.rev, status) def red_age(age): @@ -168,7 +167,7 @@ def view_summary(myself, output_type): for tree in trees: try: build = db.get_build(tree, host.name, compiler
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 5471061 Remove updating of samba-docs and lorikeet. Move samba-web and build-farm to git. via 7d275bf Remove obsolete trees samba-docs and lorikeet. Move build_farm and samba-web to git. from 8fa1f09 Simplify build_status() code. Return all found revisions in revision_details(). http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 547106195d1bd1889396b031274463019f30bc91 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 8 23:08:55 2010 +0100 Remove updating of samba-docs and lorikeet. Move samba-web and build-farm to git. commit 7d275bfb76b8e737693afb56b9e9984f1cc93055 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 8 23:08:02 2010 +0100 Remove obsolete trees samba-docs and lorikeet. Move build_farm and samba-web to git. --- Summary of changes: history|7 ++- web/trees.conf | 14 ++ 2 files changed, 4 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/history b/history index 1d65da5..590c387 100755 --- a/history +++ b/history @@ -7,11 +7,6 @@ ( -./svnlog.pl svn://svnanon.samba.org/samba-docs trunk 60 samba-docs cache/history.samba-docs -./svnlog.pl svn://svnanon.samba.org/samba-web trunk 60 samba-web cache/history.samba-web -./svnlog.pl svn://svnanon.samba.org/lorikeet trunk 60 lorikeet cache/history.lorikeet -./svnlog.pl svn://svnanon.samba.org/build-farm trunk 60 build_farm cache/history.build_farm - ./gitlog.pl /data/git/ppp.git/ 60 master cache/history.ppp ./gitlog.pl /data/git/ccache.git/ 60 master cache/history.ccache ./gitlog.pl /data/git/rsync.git/ 60 master cache/history.rsync @@ -27,5 +22,7 @@ ./gitlog.pl /data/git/samba.git/ 60 master cache/history.pidl pidl ./gitlog.pl /data/git/ctdb.git/ 60 master cache/history.ctdb +./gitlog.pl /data/git/build-farm.git/ 60 master cache/history.build_farm +./gitlog.pl /data/git/samba-web.git/ 60 master cache/history.samba-web ) history.log 21 diff --git a/web/trees.conf b/web/trees.conf index 23866a0..de50306 100644 --- a/web/trees.conf +++ b/web/trees.conf @@ -14,25 +14,15 @@ repo = ppp branch = master [build_farm] -scm = svn +scm = git repo = build-farm branch = trunk [samba-web] -scm = svn +scm = git repo = samba-web branch = trunk -[samba-docs] -scm = svn -repo = samba-docs -branch = trunk - -[lorikeet] -scm = svn -repo = lorikeeet -branch = trunk - [samba_3_current] scm = git repo = samba.git -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 9e6974d Make build_status_from_logs take files rather than huge strings. from 5471061 Remove updating of samba-docs and lorikeet. Move samba-web and build-farm to git. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 9e6974dc5ba1e112a1c35893858e9d90d9ba4961 Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 8 23:33:11 2010 +0100 Make build_status_from_logs take files rather than huge strings. --- Summary of changes: buildfarm/data.py| 26 ++ buildfarm/tests/test_data.py | 22 +- 2 files changed, 27 insertions(+), 21 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 5fe1fea..0b30cdc 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -48,6 +48,7 @@ def check_dir_exists(kind, path): def build_status_from_logs(log, err): get status of build +log = log.read() m = re.search(TEST STATUS:(\s*\d+), log) other_failures = set() if m: @@ -89,7 +90,7 @@ def build_status_from_logs(log, err): if m: other_failures.add(panic) -if No space left on device in err or No space left on device in log: +if No space left on device in log: other_failures.add(disk full) if maximum runtime exceeded in log: @@ -101,6 +102,11 @@ def build_status_from_logs(log, err): if m: stages = stages + (int(m.group(1).strip()),) +# Scan err file for specific +for l in err: +if No space left on device in l: +other_failures.add(disk full) + return BuildStatus(stages, other_failures) @@ -217,19 +223,15 @@ class Build(object): :return: tuple with build status - -f = self.read_log() +log = self.read_log() try: -log = f.read() -finally: -f.close() -f = self.read_err() -try: -err = f.read() +err = self.read_err() +try: +return build_status_from_logs(log, err) +finally: +err.close() finally: -f.close() - -return build_status_from_logs(log, err) +log.close() def err_count(self): get status of build diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 6184a64..7db834d 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -15,6 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +from cStringIO import StringIO import os import tempfile import testtools @@ -178,48 +179,51 @@ error3) class BuildStatusFromLogs(testtools.TestCase): +def parse_logs(self, log, err): +return data.build_status_from_logs(StringIO(log), StringIO(err)) + def test_nothing(self): -s = data.build_status_from_logs(, ) +s = self.parse_logs(, ) self.assertEquals((None, None, None, None), s.stages) self.assertEquals(set(), s.other_failures) def test_disk_full(self): self.assertEquals(set([disk full]), -data.build_status_from_logs(foo\nbar\nNo space left on device\nla\n, +self.parse_logs(foo\nbar\nNo space left on device\nla\n, ).other_failures) self.assertEquals(set([disk full]), -data.build_status_from_logs( +self.parse_logs( , foo\nbar\nNo space left on device\nla\n).other_failures) def test_timeout(self): self.assertEquals(set([timeout]), -data.build_status_from_logs(foo\nbar\nmaximum runtime exceeded\nla\n, +self.parse_logs(foo\nbar\nmaximum runtime exceeded\nla\n, ).other_failures) def test_status(self): log = TEST STATUS:1 -res = data.build_status_from_logs(log, ) +res = self.parse_logs(log, ) self.assertEquals(res.stages[3], 1) log = TEST STATUS: 1 -res = data.build_status_from_logs(log, ) +res = self.parse_logs(log, ) self.assertEquals(res.stages[3], 1) log = CONFIGURE STATUS: 2 TEST STATUS: 1 CC_CHECKER STATUS: 2 -res = data.build_status_from_logs(log, ) +res = self.parse_logs(log, ) self.assertEquals(res.stages[4], 2) log = CONFIGURE STATUS: 2 ACTION PASSED: test CC_CHECKER STATUS: 2 -res = data.build_status_from_logs(log, ) +res = self.parse_logs(log, ) self.assertEquals(res.stages[4], 2) self.assertEquals(res.stages[3], 255) log = @@ -231,7 +235,7 @@ testsuite-failure: bar testsuite-failure: biz CC_CHECKER STATUS: 2 -res
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 3043234 Fix syntax error. from 7483d6c Do explicit cast to string of Host attributes http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 30432342dc5f982da05e6c0ce31dc1cdc7d99d9a Author: Jelmer Vernooij jel...@samba.org Date: Mon Nov 8 23:44:20 2010 +0100 Fix syntax error. --- Summary of changes: web/build.py |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/web/build.py b/web/build.py index 4a49798..0ef018c 100755 --- a/web/build.py +++ b/web/build.py @@ -531,7 +531,9 @@ def view_host(myself, output_type, *requested_hosts): except data.NoSuchBuildError: pass else: -revision, revision_time = build.revision_details() +(revision, commit_revision, revision_time) = build.revision_details() +if commit_revision: +revision = commit_revision age_mtime = build.age_mtime() age_ctime = build.age_ctime() warnings = build.err_count() -- build.samba.org
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 3da72d3 Remove svn/cvs support. from 4bb4b4c Force to have a ldb backend for make test http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 3da72d3597747ff3a2a493df9871c37b0f37876c Author: Jelmer Vernooij jel...@samba.org Date: Tue Nov 9 08:32:23 2010 +0100 Remove svn/cvs support. --- Summary of changes: buildfarm/history.py | 96 ++ web/build.py | 11 ++ 2 files changed, 6 insertions(+), 101 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/history.py b/buildfarm/history.py index 9a074fe..51e35f4 100644 --- a/buildfarm/history.py +++ b/buildfarm/history.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# script to show recent checkins in cvs / svn / git +# script to show recent checkins in git # # Copyright (C) Andrew Tridgell tri...@samba.org 2001 # Copyright (C) Martin Pool m...@samba.org2003 @@ -24,7 +24,6 @@ from buildfarm import util import commands import os -import time BASEDIR = /home/build/master HISTORYDIR = /home/build/master/cache @@ -41,104 +40,15 @@ class History(object): return util.LoadStructure(os.path.join(HISTORYDIR, history.%s % tree)) def diff(self, author, date, tree, revision): -get recent cvs/svn entries +get recent git entries # validate the tree t = self.db.trees[tree] -if t.scm == cvs: -self._cvs_diff(t, author, date, tree) -elif t.scm == svn: -self._svn_diff(t, revision, tree) -elif t.scm == git: +if t.scm == git: self._git_diff(t, revision, tree) else: raise Exception(Unknown VCS %s % t.scm) -def _svn_diff(self, t, revision, tree): -show recent svn entries - -os.chdir(os.path.join(UNPACKED_DIR, tree)) - -# determine the most recent version known to this database -for l in commands.getoutput(svn info).splitlines(): -if l.startswith(Revision): -current_revision = l.strip().split(:) -break -else: -raise Exception(Unable to find current revision) - -if (not revision.isdigit() or int(revision) 0 or -int(revision) int(current_revision)): -raise Exception(unknown revision[%s] % revision) - -log = self._log(tree) - -# backwards? why? well, usually our users are looking for the newest -# stuff, so it's most likely to be found sooner -for i in range(len(log), 0, -1): -if log[i][REVISION] == revision: -entry = log[i] -break -else: -raise Exception(Unable to locate commit information revision[%s]. % revision) - -# get information about the current diff -title = SVN Diff in %s:%s for revision r%s % ( -tree, t.branch, revision) - -old_revision = revision - 1 -cmd = svn diff -r %s:%s % (old_revision, revision) - -return (title, entry, tree, [(cmd, commands.getoutput(%s 2 /dev/null % cmd))]) - -def _cvs_diff(self, t, author, date, tree): -show recent cvs entries -os.chdir(os.path.join(UNPACKED_DIR, tree)) - -log = self._log(tree) - -# for paranoia, check that the date string is a valid date -if not date[0].isdigit(): -raise Exception(unknown date) - -for i in range(log): -if author == log[i][AUTHOR] and date == log[i][DATE]: -entry = log[i] -break -else: -raise Exception(Unable to locate commit information author[%s] data[%s]. % ( -author, date)) - -t1 = time.ctime(date-60+(TIMEOFFSET*60*60)).strip() -t2 = time.ctime(date+60+(TIMEOFFSET*60*60)).strip() - -title = CVS Diff in %s:%s for %s % (tree, t.branch, t1) - -if entry[TAG] != and entry[REVISIONS] != : -raise Exception(sorry, cvs diff on branches not currently possible due to a limitation in cvs) - -os.environ['CVS_PASSFILE'] = os.path.join(BASEDIR, .cvspass) - -if entry[REVISIONS]: -diffs = [] -for f in entry[REVISIONS].keys(): -if entry[REVISIONS][f][REV1] == NONE: -cmd = cvs rdiff -u -r 0 -r %s %s % (entry[REVISIONS][f][REV2], f) -elif entry[REVISIONS][f][REV2] == NONE: -cmd = cvs rdiff -u -r %s -r 0 %s % ( -entry[REVISIONS][f][REV1], f) -else: -cmd = cvs diff -b -u -r %s -r %s %s % ( -entry[REVISIONS][f][REV1], entry[REVISIONS][f][REV2], f) - -diffs.append((cmd, commands.getoutput(%s 2 /dev/null
[SCM] build.samba.org - branch master updated
The branch, master has been updated via de658c7 Add log_checksum function. via 63a1c0a remove unused test.pl script. from e4357c0 Fix status sort so that sorting is the same as in the perl version http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit de658c790fd05af218357f0b16d18ee08c5db97e Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 21:56:02 2010 +0100 Add log_checksum function. commit 63a1c0aba351d5a1b6c35f4589d88e6d85ac3ca7 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 00:27:30 2010 +0100 remove unused test.pl script. --- Summary of changes: buildfarm/data.py |4 ++ web/test.pl | 114 - 2 files changed, 4 insertions(+), 114 deletions(-) delete mode 100755 web/test.pl Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index acddf84..e6521ea 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -23,6 +23,7 @@ import ConfigParser +import hashlib import os import re import time @@ -182,6 +183,9 @@ class Build(object): read full err file return util.FileLoad(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.err) +def log_checksum(self): +return hashlib.sha1(self.read_log()).hexdigest() + def revision_details(self): get the revision of build diff --git a/web/test.pl b/web/test.pl deleted file mode 100755 index 8754795..000 --- a/web/test.pl +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl - -use DBI; - -use FindBin qw($RealBin); -use lib $RealBin/..; -use DBI; -use strict; -use warnings; -use util; -use CGI; -use URI::Escape; -use hostdb; - -my $hostdb = new hostdb($RealBin/../hostdb.sqlite ) || die Cannot connect: $DBI::errstr; - -my $dbh = $hostdb-{dbh}; - -my $cgi = new CGI; - -print $cgi-header; - -sub show_summary($) -{ - my $tree = shift; - - print $cgi-start_table, - $cgi-thead($cgi-Tr($cgi-th([Test, Breakages, Last Broken Build, Hosts]))), - $cgi-start_tbody; - - my $failed = {}; - my $success = {}; - - my $resultref = $dbh-selectall_arrayref(SELECT test_run.test AS test, build.host AS host, build.compiler AS compiler, test_run.result AS testresult, build.revision AS revision, build.checksum AS checksum FROM build, test_run WHERE build.tree = ? AND test_run.build = build.id GROUP BY test, host, compiler ORDER BY revision DESC, undef, $tree); - foreach (@$resultref) { - unless (defined($failed-{$_-[0]})) { $failed-{$_-[0]} = []; } - unless (defined($success-{$_-[0]})) { $success-{$_-[0]} = 0; } - if ($_-[3] eq FAILED) { push(@{$failed-{$_-[0]}}, $_); } - elsif ($_-[3] eq PASSED) { $success-{$_-[0]}++; } - elsif ($_-[3] eq SKIPPED) {} - else { - print Unknown test result $_-[3]br; - } - } - - my @problematic_tests = (); - - foreach (keys %$failed) { - next if ($#{$failed-{$_}} == -1); - - my $numfails = $#{$failed-{$_}}+1; - - my $percentage = $numfails / ($numfails+$success-{$_}) * 100.0; - my $hosts = ; - my $last_broken_rev = 0; - foreach (@{$failed-{$_}}) { - $hosts .= $cgi-a({-href=/test.pl?build=.uri_escape($_-[5]).;test=.uri_escape($_-[0])}, $_-[1]/$_-[2]($_-[4])). ; - if ($_-[4] $last_broken_rev) { - $last_broken_rev = $_-[4]; - } - } - - push (@problematic_tests, [$last_broken_rev, $percentage, $numfails, $success-{$_}, $_, $hosts]); - } - - sub sortfn { - my $ret = $$b[0] = $$a[0]; - return $ret unless ($ret); - return $$b[1] = $$a[1]; - } - - @problematic_tests = sort { $$b[0] = $$a[0] } @problematic_tests; - - foreach (@problematic_tests) { - my ($last_broken_rev, $percentage, $numfails, $numpass, $name, $hosts) = @$_; - my $clr = int(2.55 * $percentage)+40; - print $cgi-start_Tr, - $cgi-td($cgi-a({-href=/test.pl?test=.uri_escape($name)}, $name)), - $cgi-td({-style = color: rgb($clr,.(255-$clr).,0);}, $numfails/.($numpass+$numfails).sprintf( (%.2f%%), $percentage)), - $cgi-td($last_broken_rev), - $cgi-td($hosts), - $cgi-end_Tr; - } - - print $cgi-end_tbody, $cgi-end_table; -} - -sub show_test_host($$) -{ - my ($test, $build) = @_; - - my @resultref = $dbh-selectrow_array(SELECT
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 74a3b6d Simplify status handling. via 6ccd329 Fix tests. via 3068034 Simplify host handling. from de658c7 Add log_checksum function. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 74a3b6d82d1790a8ed798e792fc80abebc8d828e Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 22:13:16 2010 +0100 Simplify status handling. commit 6ccd329877c07e37091daf7bc266770478b9a46e Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 22:13:05 2010 +0100 Fix tests. commit 30680347bfbe5e79afcbb7d92682a4c1db50ecdc Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 22:05:52 2010 +0100 Simplify host handling. --- Summary of changes: buildfarm/data.py| 13 - buildfarm/tests/test_data.py |6 +++--- web/build.py | 40 +++- 3 files changed, 22 insertions(+), 37 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index e6521ea..dd92b8e 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -39,11 +39,6 @@ class BuildStatus(object): def __str__(self): return repr((self.stages, self.other_failures)) -def setcheckerstage(self, val): -self.stages[4] = val - -def getcheckerstage(self): -return self.stages[4] def check_dir_exists(kind, path): if not os.path.isdir(path): @@ -98,13 +93,13 @@ def build_status_from_logs(log, err): if maximum runtime exceeded in log: other_failures.add(timeout) +stages = (cstatus, bstatus, istatus, tstatus) + m = re.search(CC_CHECKER STATUS:(\s*\d+), log) if m: -sstatus = int(m.group(1).strip()) -else: -sstatus = None +stages = stages + (int(m.group(1).strip()),) -return BuildStatus([cstatus, bstatus, istatus, tstatus, sstatus], other_failures) +return BuildStatus(stages, other_failures) def lcov_extract_percentage(text): diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 71ad682..a8c2f2c 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -146,7 +146,7 @@ BUILD REVISION: 42 BUILD COMMIT TIME: 3 August 2010 ) build = self.x.get_build(tdb, charis, cc) -self.assertEquals((42, 3 August 2010), build.revision_details()) +self.assertEquals((43, 3 August 2010), build.revision_details()) def test_revision_details_no_timestamp(self): self.create_mock_logfile(tdb, charis, cc, contents= @@ -155,7 +155,7 @@ BUILD REVISION: 42 BLA ) build = self.x.get_build(tdb, charis, cc) -self.assertEquals((42, None), build.revision_details()) +self.assertEquals((43, None), build.revision_details()) def test_err_count(self): self.create_mock_logfile(tdb, charis, cc) @@ -175,7 +175,7 @@ class BuildStatusFromLogs(testtools.TestCase): def test_nothing(self): s = data.build_status_from_logs(, ) -self.assertEquals((None, None, None, None, None), s.stages) +self.assertEquals((None, None, None, None), s.stages) self.assertEquals(set(), s.other_failures) def test_disk_full(self): diff --git a/web/build.py b/web/build.py index 83b58c7..473af1d 100755 --- a/web/build.py +++ b/web/build.py @@ -50,7 +50,7 @@ history = history.History(db) hostsdb = hostdb.HostDatabase(os.path.join(os.path.dirname(__file__), .., hostdb.sqlite)) compilers = db.compilers -hostsiter = hostsdb.hosts() +hosts = dict([(host.name, host) for host in hostsdb.hosts()]) trees = db.trees OLDAGE = db.OLDAGE @@ -62,14 +62,6 @@ GITWEB_BASE = http://gitweb.samba.org; # this is automatically filled in deadhosts = [] -def get_hosts(hostiterator): -d = {} -for h in hostiterator: -d[str(h.name)] = str(h.platform) -return d - -hosts = get_hosts(hostsiter) - def get_param(form, param): get a param from the request, after sanitizing it if param not in form: @@ -120,8 +112,6 @@ def html_build_status(status): def build_status(myself, tree, host, compiler, rev=None): build = db.get_build(tree, host, compiler, rev) rawstatus = build.status() -if not rawstatus.getcheckerstage() and compiler != checker: -rawstatus.setcheckerstage(-) status = html_build_status(rawstatus) return build_link(myself, tree, host, compiler, rev, status) @@ -170,12 +160,12 @@ def view_summary(myself, output_type): t = time.gmtime() yield Build status as of %s\n\n % t -for host in hosts.keys(): +for host in hosts.values(): for compiler in compilers: for tree in trees: try: -build = db.get_build(tree, host, compiler) -status
[SCM] build.samba.org - branch master updated
The branch, master has been updated via a977e10 Make read_err return a file object. via 000d005 Make read_log return a file. from 74a3b6d Simplify status handling. http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit a977e107225ddf55af846a7449b40591a023dc5a Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 22:30:02 2010 +0100 Make read_err return a file object. commit 000d0050e6b503d077511f4fdaa1e0ed6dd31c12 Author: Jelmer Vernooij jel...@samba.org Date: Sun Nov 7 22:27:23 2010 +0100 Make read_log return a file. --- Summary of changes: buildfarm/data.py| 27 ++- buildfarm/tests/test_data.py |4 ++-- web/build.py | 12 ++-- 3 files changed, 30 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index dd92b8e..74caede 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -168,18 +168,19 @@ class Build(object): def read_log(self): read full log file -f = open(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.log, r) -try: -return f.read() -finally: -f.close() +return open(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.log, r) def read_err(self): read full err file -return util.FileLoad(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.err) +return open(self._store.build_fname(self.tree, self.host, self.compiler, self.rev)+.err, 'r') + def log_checksum(self): -return hashlib.sha1(self.read_log()).hexdigest() +f = self.read_log() +try: +return hashlib.sha1(f.read()).hexdigest() +finally: +f.close() def revision_details(self): get the revision of build @@ -210,8 +211,16 @@ class Build(object): :return: tuple with build status -log = self.read_log() -err = self.read_err() +f = self.read_log() +try: +log = f.read() +finally: +f.close() +f = self.read_err() +try: +err = f.read() +finally: +f.close() return build_status_from_logs(log, err) diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index a8c2f2c..2cdc5e0 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -128,7 +128,7 @@ class BuildResultStoreTests(BuildFarmTestCase): path = self.create_mock_logfile(tdb, charis, cc, contents=This is what a log file looks like.) build = self.x.get_build(tdb, charis, cc) -self.assertEquals(This is what a log file looks like., build.read_log()) +self.assertEquals(This is what a log file looks like., build.read_log().read()) def test_read_err(self): self.create_mock_logfile(tdb, charis, cc) @@ -136,7 +136,7 @@ class BuildResultStoreTests(BuildFarmTestCase): kind=stderr, contents=This is what an stderr file looks like.) build = self.x.get_build(tdb, charis, cc) -self.assertEquals(This is what an stderr file looks like., build.read_err()) +self.assertEquals(This is what an stderr file looks like., build.read_err().read()) def test_revision_details(self): self.create_mock_logfile(tdb, charis, cc, contents= diff --git a/web/build.py b/web/build.py index 473af1d..93c6086 100755 --- a/web/build.py +++ b/web/build.py @@ -403,8 +403,16 @@ def view_build(myself, tree, host, compiler, rev, plain_logs=False): if rev: assert re.match(^[0-9a-fA-F]*$, rev) -log = build.read_log() -err = build.read_err() +f = build.read_log() +try: +log = f.read() +finally: +f.close() +f = build.read_err() +try: +err = f.read() +finally: +f.close() if log: log = cgi.escape(log) -- build.samba.org
Re: [SCM] build.samba.org - branch master updated
On Sat, 2010-11-06 at 11:17 +0300, Matthieu Patou wrote: Hi Jelmer, On 06/11/2010 05:26, Jelmer Vernooij wrote: The branch, master has been updated via 6505499 Inline test data. via 9bce367 PEP8 via 9f62c2b Add more tests. via a72e3d2 Default rev to None, consistent with other code. from 2b9b526 Fix a bug http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 65054993bf7cf96f17517bcc7edcc3db32de0667 Author: Jelmer Vernooijjel...@samba.org Date: Fri Nov 5 20:29:36 2010 +0100 Inline test data. commit 9bce36774b255246de091ad7a5810a72d9689d0c Author: Jelmer Vernooijjel...@samba.org Date: Fri Nov 5 20:16:41 2010 +0100 PEP8 commit 9f62c2bee32bac90800a8925223c2ebb9491ad9d Author: Jelmer Vernooijjel...@samba.org Date: Fri Nov 5 20:10:17 2010 +0100 Add more tests. commit a72e3d2abecf16202750a8a4b448a6fe5a1c0786 Author: Jelmer Vernooijjel...@samba.org Date: Fri Nov 5 20:04:43 2010 +0100 Default rev to None, consistent with other code. --- Summary of changes: buildfarm/data.py | 37 ++- buildfarm/tests/test_data.py | 63 ++-- buildfarm/tests/test_util.py | 24 --- buildfarm/tests/testlist |5 --- buildfarm/tests/testtree.conf |9 -- buildfarm/tests/testtree2.conf | 10 -- 6 files changed, 82 insertions(+), 66 deletions(-) delete mode 100644 buildfarm/tests/testlist delete mode 100644 buildfarm/tests/testtree.conf delete mode 100644 buildfarm/tests/testtree2.conf Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index e2502d2..8a2ce6c 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -86,8 +86,7 @@ def build_status_from_logs(log, err): else: sstatus = None -return {config: cstatus, build: bstatus, install: istatus,\ -test: tstatus, checker: sstatus, other: other_failures} +return ((cstatus, bstatus, istatus, tstatus, sstatus), other_failures) Frankly speaking I thinking having a dictionnary/hash as we can extend without problem the structure to add more status ... The issue with a dictionary is that it's not ordered, with a tuple there is an order in the statusses (configure, build, test, install, checker). I'd be happy to change it to a namedtuple if you'd like to be able to explicitly name the statusses. I'd be happy to see the base type changed to a custom (BuildStatus ?) class. Cheers, Jelmer signature.asc Description: This is a digitally signed message part
[SCM] build.samba.org - branch master updated
The branch, master has been updated via 7adca02 Add convenience class for build status. via 9ea3ef1 Merge build_status_from_logs tests. from 448ed75 Add my copyright http://gitweb.samba.org/?p=build-farm.git;a=shortlog;h=master - Log - commit 7adca02a235bd96ef30eb7182f817192ccd5b7f4 Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 6 19:14:45 2010 +0100 Add convenience class for build status. commit 9ea3ef139887c465afa08fa68f670072f25a706c Author: Jelmer Vernooij jel...@samba.org Date: Sat Nov 6 18:58:35 2010 +0100 Merge build_status_from_logs tests. --- Summary of changes: buildfarm/data.py| 16 +- buildfarm/tests/test_data.py | 101 +- web/build.py | 12 ++--- 3 files changed, 68 insertions(+), 61 deletions(-) Changeset truncated at 500 lines: diff --git a/buildfarm/data.py b/buildfarm/data.py index 0e1e94f..2bbbd74 100644 --- a/buildfarm/data.py +++ b/buildfarm/data.py @@ -29,6 +29,16 @@ import time import util +class BuildStatus(object): + +def __init__(self, stages, other_failures): +self.stages = stages +self.other_failures = other_failures + +def __str__(self): +return repr((self.stages, self.other_failures)) + + def check_dir_exists(kind, path): if not os.path.isdir(path): raise Exception(%s directory %s does not exist % (kind, path)) @@ -86,7 +96,7 @@ def build_status_from_logs(log, err): else: sstatus = None -return ((cstatus, bstatus, istatus, tstatus, sstatus), other_failures) +return BuildStatus((cstatus, bstatus, istatus, tstatus, sstatus), other_failures) def lcov_extract_percentage(text): @@ -274,12 +284,12 @@ class CachingBuild(Build): st2 = None if st2 and st1.st_ctime = st2.st_mtime: -return eval(util.FileLoad(cachefile)) +return BuildStatus(*eval(util.FileLoad(cachefile))) ret = super(CachingBuild, self).status() if not self._store.readonly: -util.FileSave(cachefile, repr(ret)) +util.FileSave(cachefile, str(ret)) return ret diff --git a/buildfarm/tests/test_data.py b/buildfarm/tests/test_data.py index 6ef0a18..b566c73 100755 --- a/buildfarm/tests/test_data.py +++ b/buildfarm/tests/test_data.py @@ -32,47 +32,6 @@ 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): @@ -213,23 +172,63 @@ error3) self.assertTrue(self.x.has_host(charis)) - -class LogParserTests(unittest.TestCase): +class BuildStatusFromLogs(testtools.TestCase): def test_nothing(self): -self.assertEquals(((None, None, None, None, None), set()), -data.build_status_from_logs(, )) +s = data.build_status_from_logs(, ) +self.assertEquals((None, None, None, None, None), s.stages) +self.assertEquals(set(), s.other_failures) def test_disk_full(self): -self.assertEquals(((None, None, None, None, None), set([disk full])), +self.assertEquals(set([disk full]), data.build_status_from_logs(foo\nbar\nNo space left on device\nla\n, -)) -self.assertEquals(((None, None, None, None, None), set([disk full])), +).other_failures) +self.assertEquals(set([disk full]), data.build_status_from_logs( -, foo\nbar\nNo space left on device\nla\n)) +, foo\nbar\nNo space left on device\nla\n).other_failures) def test_timeout(self): -self.assertEquals(((None, None, None, None, None), set([timeout])), +self.assertEquals