Taking care of try builds when writing sum files

This commit is contained in:
Sergio Durigan Junior 2016-11-10 14:35:52 -05:00
parent 630197c09f
commit d7e4296d8e
2 changed files with 21 additions and 14 deletions

View file

@ -68,6 +68,7 @@ class GdbCatSumfileCommand(steps.ShellCommand):
rev = self.getProperty('got_revision')
builder = self.getProperty('buildername')
istrysched = self.getProperty('isTrySched')
istry = istrysched and istrysched == 'yes'
branch = self.getProperty('branch')
db_file = os.path.join (get_web_base (), builder, builder + '.db')
parser = DejaResults()
@ -79,12 +80,12 @@ class GdbCatSumfileCommand(steps.ShellCommand):
if not os.path.exists (db_file):
# This takes care of our very first build.
parser.write_sum_file (cur_results, builder, branch, rev)
parser.write_sum_file (cur_results, builder, branch, rev, istry)
# If there was no previous baseline, then this run
# gets the honor.
if baseline is None:
baseline = cur_results
parser.write_baseline (baseline, builder, branch, rev)
parser.write_baseline (baseline, builder, branch, rev, istry)
return SUCCESS
con = sqlite3.connect (db_file)
@ -97,12 +98,12 @@ class GdbCatSumfileCommand(steps.ShellCommand):
prevcommit = prev[0]
else:
# This takes care of our very first build.
parser.write_sum_file (cur_results, builder, branch, rev)
parser.write_sum_file (cur_results, builder, branch, rev, istry)
# If there was no previous baseline, then this run
# gets the honor.
if baseline is None:
baseline = cur_results
parser.write_baseline (baseline, builder, branch, rev)
parser.write_baseline (baseline, builder, branch, rev, istry)
return SUCCESS
baseline = parser.read_baseline (builder, branch, prevcommit)
@ -123,14 +124,14 @@ class GdbCatSumfileCommand(steps.ShellCommand):
self.addCompleteLog ('regressions', report)
result = FAILURE
if istrysched and istrysched == 'yes':
if istry:
parser.write_try_build_sum_file (cur_results, builder, branch, rev)
else:
parser.write_sum_file (cur_results, builder, branch, rev)
parser.write_sum_file (cur_results, builder, branch, rev, istry)
# If there was no previous baseline, then this run
# gets the honor.
if baseline is None:
baseline = cur_results
parser.write_baseline (baseline, builder, branch, rev)
parser.write_baseline (baseline, builder, branch, rev, istry)
return result

View file

@ -69,10 +69,14 @@ class DejaResults(object):
# and to the set.
out_dict[1][result].add (test_name)
def _write_sum_file(self, sum_dict, builder, rev, filename, header = None):
def _write_sum_file(self, sum_dict, builder, rev, filename, header = None, istry):
global gdb_web_base
bdir = os.path.join (gdb_web_base, builder, rev[:2], rev)
if istry:
bdir = os.path.join (gdb_web_base, builder, 'try', rev[:2], rev)
else:
bdir = os.path.join (gdb_web_base, builder, rev[:2], rev)
if not os.path.exists (bdir):
old_umask = os.umask (0022)
os.makedirs (bdir)
@ -90,16 +94,18 @@ class DejaResults(object):
f.write (sum_dict[0][k] + ': ' + k + '\n')
os.umask (old_umask)
def write_sum_file(self, sum_dict, builder, branch, rev):
self._write_sum_file (sum_dict, builder, rev, 'gdb.sum')
def write_sum_file(self, sum_dict, builder, branch, rev, istry):
self._write_sum_file (sum_dict, builder, rev, 'gdb.sum', istry = istry)
def write_try_build_sum_file (self, sum_dict, builder, branch, rev):
self._write_sum_file (sum_dict, builder, rev, 'trybuild_gdb.sum',
header = "### THIS SUM FILE WAS GENERATED BY A TRY BUILD ###\n\n")
header = "### THIS SUM FILE WAS GENERATED BY A TRY BUILD ###\n\n",
istry = True)
def write_baseline(self, sum_dict, builder, branch, rev):
def write_baseline(self, sum_dict, builder, branch, rev, istry):
self._write_sum_file(sum_dict, builder, rev, 'baseline',
header = "### THIS BASELINE WAS LAST UPDATED BY COMMIT %s ###\n\n" % rev)
header = "### THIS BASELINE WAS LAST UPDATED BY COMMIT %s ###\n\n" % rev,
istry = istry)
# Read a .sum file.
# The builder name is BUILDER.