def handle_exception(plugin, details): # FIXME: Introduce avocado.exceptions logger and use here stacktrace.log_message( "Test discovery plugin %s failed: " "%s" % (plugin, details), LOG_UI.getChild("exceptions")) # FIXME: Introduce avocado.traceback logger and use here stacktrace.log_exc_info(sys.exc_info(), LOG_UI.getChild("debug"))
def create_test_suite(references): """ Creates the test suite for this Job This is a public Job API as part of the documented Job phases NOTE: This is similar to avocado.core.Job.create_test_suite """ try: suite = loader.loader.discover(references) except loader.LoaderError as details: stacktrace.log_exc_info(sys.exc_info(), LOG_UI.getChild("debug")) raise exceptions.OptionValidationError(details) if not suite: if references: references = " ".join(references) e_msg = ("No tests found for given test references, try " "'avocado list -V %s' for details" % references) else: e_msg = ("No test references provided nor any other arguments " "resolved into tests. Please double check the " "executed command.") raise exceptions.OptionValidationError(e_msg) return suite
import random import logging from avocado.core.output import LOG_UI from avocado.core.output import Throbber from .Solver import Solver from .CombinationMatrix import CombinationMatrix ITERATIONS_SIZE = 600 LOG = LOG_UI.getChild("Cit") LOG.setLevel(logging.INFO) class Cit: def __init__(self, input_data, t_value, constraints): """ Creation of CombinationMatrix from user input :param input_data: parameters from user :param t_value: size of one combination :param constraints: constraints of combinations """ self.data = input_data self.t_value = t_value # CombinationMatrix creation self.combination_matrix = CombinationMatrix(input_data, t_value) # Creation of solver and simplification of constraints self.solver = Solver(input_data, constraints) # Combinations which do not match to the constraints are disabled self.solver.clean_hash_table(self.combination_matrix, t_value)