From 579a7c10a70e7687b2e71f633033313ec82f9f8c Mon Sep 17 00:00:00 2001 From: jadmanski Date: Tue, 10 Mar 2009 04:21:03 +0000 Subject: Add support to the autotest parser for updating RUNNING test results with new reason values so long as tests write out multiple status messages. This would allow tests (particularly long-running ones) to record early success or failure information. Risk: Low Visibility: If tests write out multiple status messages, RUNNING records will grab their reasons. Otherwise, there should be no visible change. Signed-off-by: John Admanski git-svn-id: svn://test.kernel.org/autotest/trunk@2861 592f7852-d20e-0410-864c-8624ca9c26a4 --- tko/parsers/version_1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tko/parsers') diff --git a/tko/parsers/version_1.py b/tko/parsers/version_1.py index 1d223915..58cc42ff 100644 --- a/tko/parsers/version_1.py +++ b/tko/parsers/version_1.py @@ -179,6 +179,7 @@ class parser(base.parser): started_time_stack = [None] subdir_stack = [None] running_test = None + running_reasons = [] yield [] # we're ready to start running # create a RUNNING SERVER_JOB entry to represent the entire test @@ -257,6 +258,9 @@ class parser(base.parser): min_stack_size = stack.size() elif stack.size() == min_stack_size + 1 and not running_test: # we just started a new test, insert a running record + running_reasons = [] + if line.reason: + running_reasons.append(line.reason) running_test = test.parse_partial_test(self.job, line.subdir, line.testname, @@ -286,6 +290,13 @@ class parser(base.parser): current_status): if line.reason: current_reason = line.reason + # update the status of a currently running test + if running_test: + running_reasons.append(line.reason) + running_test.reason = ", ".join(running_reasons) + new_tests.append(running_test) + msg = "update RUNNING reason: %s" % line.reason + tko_utils.dprint(msg) current_status = stack.current_status() started_time = None finished_time = line.get_timestamp() -- cgit v1.2.3