提交 793b1993 编写于 作者: D Dmitry Monakhov

resultsdb: Show result log url in human mode

It would be nice to show result url in output.
ResultEvent class is not good for that because it is called too early,
and makes output looks ugly. Let's use Result.render hook which is
specially designed for this stage
Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
上级 3c9dad04
......@@ -23,13 +23,14 @@ import time
import resultsdb_api
from six import iteritems
from avocado.core.plugin_interfaces import CLI, ResultEvents
from avocado.core.plugin_interfaces import CLI, ResultEvents, Result
from avocado.core.settings import settings
from avocado.core import exceptions
from avocado.utils import stacktrace
from avocado.core.output import LOG_UI
class ResultsdbResult(ResultEvents):
class ResultsdbResultEvent(ResultEvents):
"""
ResultsDB output class
......@@ -142,6 +143,21 @@ class ResultsdbResult(ResultEvents):
return 'NEEDS_INSPECTION'
class ResultsdbResult(Result):
"""
ResultsDB render class
"""
name = 'resultsdb'
description = 'Resultsdb result support'
def render(self, result, job):
if getattr(job.args, 'resultsdb_logs', None) is not None:
LOG_UI.info("JOB URL : %s/%s" % (job.args.resultsdb_logs,
os.path.basename(job.logdir)))
class ResultsdbCLI(CLI):
"""
......
......@@ -30,5 +30,8 @@ setup(name='avocado-framework-plugin-resultsdb',
'resultsdb = avocado_resultsdb:ResultsdbCLI',
],
'avocado.plugins.result_events': [
'resultsdb = avocado_resultsdb:ResultsdbResultEvent',
],
'avocado.plugins.result': [
'resultsdb = avocado_resultsdb:ResultsdbResult',
]})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册