Stop test execution in case of an plugin error
Without setting the on_load_failure_callback parameter failures are ignored (only logged). This can be critical in gate jobs. Change-Id: I820784d759d6dc60ed86d29d90ef900207d848ad Closes-Bug: #1474765changes/12/202012/1
parent
b5b118fb20
commit
25319f6fa0
|
@ -13,12 +13,16 @@
|
|||
# under the License.
|
||||
|
||||
import abc
|
||||
import logging
|
||||
|
||||
import six
|
||||
import stevedore
|
||||
from tempest_lib.common.utils import misc
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class TempestPlugin(object):
|
||||
"""A TempestPlugin class provides the basic hooks for an external
|
||||
|
@ -47,7 +51,13 @@ class TempestTestPluginManager(object):
|
|||
def __init__(self):
|
||||
self.ext_plugins = stevedore.ExtensionManager(
|
||||
'tempest.test_plugins', invoke_on_load=True,
|
||||
propagate_map_exceptions=True)
|
||||
propagate_map_exceptions=True,
|
||||
on_load_failure_callback=self.failure_hook)
|
||||
|
||||
@staticmethod
|
||||
def failure_hook(_, ep, err):
|
||||
LOG.error('Could not load %r: %s', ep.name, err)
|
||||
raise err
|
||||
|
||||
def get_plugin_load_tests_tuple(self):
|
||||
load_tests_dict = {}
|
||||
|
|
Loading…
Reference in New Issue