提交 bb8a7f5c 编写于 作者: C Cleber Rosa

test result output: allow for test specific progress indication

The throbber that gives visual indication of progress can now show if the progress
includes test specific progress (GREEN) or if the test process is running (YELLOW)
but actual progress is unknown.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 7161ee57
......@@ -222,8 +222,22 @@ class OutputManager(object):
self.console_log = logging.getLogger('avocado.app')
self.throbber_pos = 0
def throbber_progress(self):
self.log_healthy(self.THROBBER_MOVES[self.throbber_pos], True)
def throbber_progress(self, progress_from_test=False):
"""
Give an interactive indicator of the test progress
:param progress_from_test: if indication of progress came explicitly
from the test. If false, it means the test
process is running, but not communicating
test specific progress.
:type progress_from_test: bool
:rtype: None
"""
if progress_from_test:
self.log_healthy(self.THROBBER_MOVES[self.throbber_pos], True)
else:
self.log_partial(self.THROBBER_MOVES[self.throbber_pos], True)
if self.throbber_pos == (len(self.THROBBER_MOVES)-1):
self.throbber_pos = 0
else:
......
......@@ -38,10 +38,10 @@ class TestResultProxy(object):
else:
return None
def throbber_progress(self):
def throbber_progress(self, progress_from_test=False):
for output_plugin in self.output_plugins:
if hasattr(output_plugin, 'throbber_progress'):
output_plugin.throbber_progress()
output_plugin.throbber_progress(progress_from_test)
def add_output_plugin(self, plugin):
if not isinstance(plugin, TestResult):
......@@ -358,5 +358,5 @@ class HumanTestResult(TestResult):
TestResult.add_warn(self, state)
self.stream.log_warn(state['time_elapsed'])
def throbber_progress(self):
self.stream.throbber_progress()
def throbber_progress(self, progress_from_test=False):
self.stream.throbber_progress(progress_from_test)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册