[autotest] Make all dynamic_suite status recording use Status objects
The Suite class uses record_entry() for status, which takes a fully-constructed
status_log_entry. The Reimager class was using the record() method that takes
some of same parameters used to create a status_log_entry. Standardize, because
we're going to need the additional flexibility gained by minting our own
status_log_entry objects in some soon-to-land CLs.
BUG=chromium-os:22060
TEST=run_suite; ensure that each host that's reimaged has its own status entry.
Change-Id: Id8352936e464676f948e34e2ddd36e89baad6015
Reviewed-on: https://gerrit.chromium.org/gerrit/26339
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
diff --git a/site_utils/run_suite.py b/site_utils/run_suite.py
index b408314..e5144f5 100755
--- a/site_utils/run_suite.py
+++ b/site_utils/run_suite.py
@@ -135,8 +135,7 @@
payload_end_time = None
artifact_end_time = None
suite_start_time = None
- reimage_start_time = None
- reimage_end_time = None
+ reimage_times = {} # {'hostname': (start_time, end_time)}
tests_start_time = None
tests_end_time = None
@@ -157,9 +156,9 @@
job_status.TIME_FMT)
if entry['test_name'] == 'SERVER_JOB':
self.suite_start_time = start_candidate
- elif entry['test_name'] == 'try_new_image':
- self.reimage_start_time = start_candidate
- self.reimage_end_time = end_candidate
+ elif entry['test_name'].startswith('try_new_image'):
+ hostname = entry['test_name'].split('-', 1)[1]
+ self.reimage_times[hostname] = (start_candidate, end_candidate)
else:
self._UpdateFirstTestStartTime(start_candidate)
self._UpdateLastTestEndTime(end_candidate)
@@ -191,20 +190,23 @@
def __str__(self):
+ reimaging_info = ''
+ for host, (start, end) in self.reimage_times.iteritems():
+ reimaging_info += ('Reimaging %s started at %s\n'
+ 'Reimaging %s ended at %s\n' % (host, start,
+ host, end))
return ('\n'
'Suite timings:\n'
'Downloads started at %s\n'
'Payload downloads ended at %s\n'
'Suite started at %s\n'
- 'Reimaging started at %s\n'
- 'Reimaging ended at %s\n'
+ '%s'
'Artifact downloads ended (at latest) at %s\n'
'Testing started at %s\n'
'Testing ended at %s\n' % (self.download_start_time,
self.payload_end_time,
self.suite_start_time,
- self.reimage_start_time,
- self.reimage_end_time,
+ reimaging_info,
self.artifact_end_time,
self.tests_start_time,
self.tests_end_time))