提交 d9d44d0c 编写于 作者: L Lukáš Doktor

core.loader: Log discover_url exceptions

The `discover_url` function should not fail, instead it should return
empty results. In case of failure, it's impossible to find out what
went wrong as we don't log any details, thus it might happen that
`avocado list` shows tests, which are not found during `avocado run`.
This patch temporarily logs reason into the `avocado.app.exceptions`
and traceback into the `avocado.app.traceback` logger. Booth are
enabled by default, but the plan is to make these optional and
show only the `exceptions` by default.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 e66a04dd
......@@ -26,7 +26,7 @@ import sys
from . import data_dir
from . import test
from . import output
from ..utils import path
from ..utils import path, stacktrace
try:
import cStringIO as StringIO
......@@ -122,8 +122,14 @@ class TestLoaderProxy(object):
self.url_plugin_mapping[url] = loader_plugin
if loader_plugin == self.url_plugin_mapping[url]:
test_factories += loader_plugin.discover(params_list_from_url)
except Exception:
continue
except Exception, details:
# FIXME: Introduce avocado.exceptions logger and use here
stacktrace.log_message("Test discovery plugin %s failed: "
"%s" % (loader_plugin, details),
'avocado.app.exceptions')
# FIXME: Introduce avocado.traceback logger and use here
stacktrace.log_exc_info(sys.exc_info(),
'avocado.app.tracebacks')
return test_factories
def validate_ui(self, test_suite, ignore_missing=False,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册