Implementing a new way to store test results

This commit is contained in:
Sergio Durigan Junior 2014-12-23 20:22:22 -05:00
parent 633aad43c6
commit 6cbe15bbbe
2 changed files with 28 additions and 21 deletions

View file

@ -46,15 +46,15 @@ class DejaResults(object):
test_name = nname test_name = nname
out_dict[test_name] = result out_dict[test_name] = result
def _write_sum_file(self, sum_dict, subdir, filename, is_baseline): def _write_sum_file(self, sum_dict, subdir, revision, filename):
global gdb_web_base global gdb_web_base
if not revision:
bdir = os.path.join(gdb_web_base, subdir, revision)
else:
bdir = os.path.join (gdb_web_base, subdir) bdir = os.path.join (gdb_web_base, subdir)
if not os.path.isdir(bdir): if not os.path.isdir(bdir):
os.makedirs(bdir, 0755) os.makedirs(bdir, 0755)
if is_baseline:
fname = os.path.join(bdir, filename) fname = os.path.join(bdir, filename)
else:
fname = os.path.join(bdir, 'gdb.sum')
keys = sum_dict.keys() keys = sum_dict.keys()
keys.sort() keys.sort()
f = open(fname, 'w') f = open(fname, 'w')
@ -62,12 +62,12 @@ class DejaResults(object):
f.write(sum_dict[k] + ': ' + k + '\n') f.write(sum_dict[k] + ': ' + k + '\n')
f.close() f.close()
def write_sum_file(self, sum_dict, builder, filename): def write_sum_file(self, sum_dict, builder, revision):
self._write_sum_file(sum_dict, builder, filename, False) 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),
'baseline', True) None, 'baseline')
# Read a .sum file. # Read a .sum file.
# The builder name is BUILDER. # The builder name is BUILDER.
@ -75,12 +75,12 @@ class DejaResults(object):
# revision; to read the baseline file for a branch, use `read_baseline'. # revision; to read the baseline file for a branch, use `read_baseline'.
# Returns a dictionary holding the .sum contents, or None if the # Returns a dictionary holding the .sum contents, or None if the
# file did not exist. # file did not exist.
def _read_sum_file(self, builder, filename, is_baseline): def _read_sum_file(self, subdir, revision, filename):
global gdb_web_base global gdb_web_base
if is_baseline: if not revision:
fname = os.path.join(gdb_web_base, builder, filename) fname = os.path.join(gdb_web_base, subdir, filename)
else: else:
fname = os.path.join(gdb_web_base, builder, 'gdb.sum') fname = os.path.join (gdb_web_base, subdir, revision, filename)
if os.path.exists(fname): if os.path.exists(fname):
result = {} result = {}
f = open(fname, 'r') f = open(fname, 'r')
@ -91,11 +91,15 @@ class DejaResults(object):
result = None result = None
return result return result
def read_sum_file (self, builder, filename): def read_sum_file (self, builder, revision):
return self._read_sum_file (builder, filename, False) 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(builder, os.path.join(branch, 'baseline'), True) return self._read_sum_file(os.path.join(builder, branch),
None, 'baseline')
def read_xfail (self, builder):
return self._read_sum_file (builder, None, 'xfail')
# Parse some text as a .sum file and return the resulting # Parse some text as a .sum file and return the resulting
# dictionary. # dictionary.
@ -113,7 +117,7 @@ class DejaResults(object):
our_keys = results.keys() our_keys = results.keys()
our_keys.sort() our_keys.sort()
result = '' result = ''
xfails = self.read_sum_file(builder, 'xfail') xfails = self.read_xfail (builder)
if xfails is None: if xfails is None:
xfails = {} xfails = {}
for key in our_keys: for key in our_keys:

View file

@ -413,9 +413,12 @@ The parameters of the class are:
self.addStep (GdbCatSumfileCommand (workdir = WithProperties ('%s/build/gdb/testsuite', self.addStep (GdbCatSumfileCommand (workdir = WithProperties ('%s/build/gdb/testsuite',
'builddir'), 'builddir'),
description = 'analyze test results')) description = 'analyze test results'))
self.addStep (FileUpload (slavesrc = WithProperties ("%s/build/gdb/testsuite/gdb.log", 'builddir'), self.addStep (FileUpload (slavesrc = WithProperties ("%s/build/gdb/testsuite/gdb.log",
masterdest = WithProperties ("public_html/results/%s/gdb.log", 'buildername'))) 'builddir'),
self.addStep (SaveGDBResults ()) masterdest = WithProperties ("public_html/results/%s/%s/gdb.log",
'buildername',
'got_revision')))
# self.addStep (SaveGDBResults ())
################## ##################