avocado.job: Call throbber progress conditionally

Previously, the throbber update method was being called
unconditionally, making throbber progress to appear even
when human output was not enabled. Fix this by making
a proxy method that calls it only if there is a human
plugin enabled, in TestResultProxy.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 2d5836af
...@@ -184,7 +184,7 @@ class TestRunner(object): ...@@ -184,7 +184,7 @@ class TestRunner(object):
test_state = q.get(timeout=cycle_timeout) test_state = q.get(timeout=cycle_timeout)
except Queue.Empty: except Queue.Empty:
if p.is_alive(): if p.is_alive():
self.job.output_manager.throbber_progress() self.job.result_proxy.throbber_progress()
else: else:
should_quit = True should_quit = True
......
...@@ -38,6 +38,11 @@ class TestResultProxy(object): ...@@ -38,6 +38,11 @@ class TestResultProxy(object):
else: else:
return None return None
def throbber_progress(self):
for output_plugin in self.output_plugins:
if hasattr(output_plugin, 'throbber_progress'):
output_plugin.throbber_progress()
def add_output_plugin(self, plugin): def add_output_plugin(self, plugin):
if not isinstance(plugin, TestResult): if not isinstance(plugin, TestResult):
raise InvalidOutputPlugin("Object %s is not an instance of " raise InvalidOutputPlugin("Object %s is not an instance of "
...@@ -323,3 +328,6 @@ class HumanTestResult(TestResult): ...@@ -323,3 +328,6 @@ class HumanTestResult(TestResult):
""" """
TestResult.add_warn(self, state) TestResult.add_warn(self, state)
self.stream.log_warn(state['time_elapsed']) self.stream.log_warn(state['time_elapsed'])
def throbber_progress(self):
self.stream.throbber_progress()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册