From d7e4296d8e720528b9e4ce9cc4a11549be3e3e41 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Thu, 10 Nov 2016 14:35:52 -0500 Subject: [PATCH] Taking care of try builds when writing sum files --- lib/gdbcommand.py | 15 ++++++++------- lib/sumfiles.py | 20 +++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/gdbcommand.py b/lib/gdbcommand.py index 143e7a8..9ef4f4f 100644 --- a/lib/gdbcommand.py +++ b/lib/gdbcommand.py @@ -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 diff --git a/lib/sumfiles.py b/lib/sumfiles.py index a934b3f..f634063 100644 --- a/lib/sumfiles.py +++ b/lib/sumfiles.py @@ -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.