Activating git-db again; a few adjustments needed in the code because of that

This commit is contained in:
Sergio Durigan Junior 2015-01-11 18:25:48 -05:00
parent 0a1a2f9618
commit 4e0c9e93de
3 changed files with 34 additions and 23 deletions

View file

@ -20,17 +20,32 @@ class SaveGDBResults (ShellCommand):
builder = self.getProperty ('buildername') builder = self.getProperty ('buildername')
istry = self.getProperty ('isTryBuilder') istry = self.getProperty ('isTryBuilder')
branch = self.getProperty ('branch') branch = self.getProperty ('branch')
repodir = os.path.join (get_web_base (), builder) repodir = get_web_base ()
builder_dir = os.path.join (repodir, builder)
full_tag = "%s-%s" % (builder, rev)
if branch is None: if branch is None:
branch = 'master' branch = 'master'
if istry and istry == 'yes': if istry and istry == 'yes':
# Do nothing # Do nothing
return SUCCESS return SUCCESS
repo = git.Repo.init (path = repodir) repo = git.Repo.init (path = repodir)
if rev not in repo.tags: if not os.path.exists (builder_dir):
if not repo.branches or repo.is_dirty (): os.mkdir (builder_dir)
repo.index.add (['gdb.sum', 'gdb.log', '%s/baseline' % branch])
repo.index.commit ('Log files for %s' % rev) if builder not in repo.heads:
myhead = repo.create_head (builder)
else:
myhead = repo.heads[builder]
myhead.checkout ()
if full_tag not in repo.tags:
if repo.is_dirty ():
repo.index.add (['%s/gdb.sum' % builder,
'%s/gdb.log' % builder,
'%s/%s/baseline' % (builder, branch)])
repo.index.commit ('Log files for %s' % full_tag)
repo.index.write () repo.index.write ()
repo.create_tag (rev) repo.create_tag (full_tag)
return SUCCESS return SUCCESS

View file

@ -63,7 +63,8 @@ class DejaResults(object):
f.close() f.close()
def write_sum_file(self, sum_dict, builder, revision): def write_sum_file(self, sum_dict, builder, revision):
self._write_sum_file(sum_dict, builder, revision, 'gdb.sum') self._write_sum_file (sum_dict, builder, None, 'gdb.sum')
# self._write_sum_file(sum_dict, builder, revision, 'gdb.sum')
def write_baseline(self, sum_dict, builder, branch): def write_baseline(self, sum_dict, builder, branch):
self._write_sum_file(sum_dict, os.path.join(builder, branch), self._write_sum_file(sum_dict, os.path.join(builder, branch),
@ -92,7 +93,8 @@ class DejaResults(object):
return result return result
def read_sum_file (self, builder, revision): def read_sum_file (self, builder, revision):
return self._read_sum_file (builder, revision, 'gdb.sum') return self._read_sum_file (builder, None, 'gdb.sum')
# return self._read_sum_file (builder, revision, 'gdb.sum')
def read_baseline(self, builder, branch): def read_baseline(self, builder, branch):
return self._read_sum_file(os.path.join(builder, branch), return self._read_sum_file(os.path.join(builder, branch),

View file

@ -49,7 +49,8 @@ c = BuildmasterConfig = {}
# Base directory for the web server. This is needed in order to # Base directory for the web server. This is needed in order to
# compare the test results. # compare the test results.
gdb_web_base = os.path.expanduser(os.path.join(basedir, 'public_html', gdb_web_base = os.path.expanduser (os.path.join (basedir,
'public_html',
'results')) 'results'))
set_web_base (gdb_web_base) set_web_base (gdb_web_base)
@ -210,14 +211,6 @@ c['db'] = {
## the documentation on each build step class to understand what it ## the documentation on each build step class to understand what it
## does. ## does.
class DeleteGDBBuildDir (ShellCommand):
"""This build step is responsible for removing the build directory
from previous builds. It uses the 'builddir' property in order to
figure out which directory to remove."""
description = r"deleting previous GDB build directory"
descriptionDone = r"deleted previous GDB build directory"
command = ['rm', '-rf', WithProperties (r"%s/build", r'builddir')]
class RandomWaitForClone (ShellCommand): class RandomWaitForClone (ShellCommand):
"""This build step is responsible for waiting a random number of """This build step is responsible for waiting a random number of
seconds before trying to update the local git repository. This is a seconds before trying to update the local git repository. This is a
@ -409,7 +402,6 @@ The parameters of the class are:
r'builddir'), r'builddir'),
description = r"removing old build dir", description = r"removing old build dir",
descriptionDone = r"removed old build dir")) descriptionDone = r"removed old build dir"))
# self.addStep (DeleteGDBBuildDir ())
# Unfortunately we need to have this random wait, otherwise # Unfortunately we need to have this random wait, otherwise
# git fetch won't work # git fetch won't work
self.addStep (RandomWaitForClone ()) self.addStep (RandomWaitForClone ())
@ -444,10 +436,12 @@ The parameters of the class are:
description = r'analyze test results')) description = r'analyze test results'))
self.addStep (FileUpload (slavesrc = WithProperties (r"%s/build/gdb/testsuite/gdb.log", self.addStep (FileUpload (slavesrc = WithProperties (r"%s/build/gdb/testsuite/gdb.log",
r'builddir'), r'builddir'),
masterdest = WithProperties (r"public_html/results/%s/%s/gdb.log", masterdest = WithProperties (r"publibc_html/results/%s/gdb.log",
r'buildername', r'buildername'))
r'got_revision'))) # masterdest = WithProperties (r"public_html/results/%s/%s/gdb.log",
# self.addStep (SaveGDBResults ()) # r'buildername',
# r'got_revision')))
self.addStep (SaveGDBResults ())
################## ##################