def runTestCases(test_cases, options, cmd_line_options): log.debug("Running %s" % test_cases) log.debug("Options %s" % options) log.debug("cmd_line_options %s" % dict(cmd_line_options)) test_inputs = options['inputs'] oonib_reporter = OONIBReporter(cmd_line_options) yaml_reporter = YAMLReporter(cmd_line_options) if cmd_line_options['collector']: log.msg("Using remote collector, please be patient while we create the report.") try: yield oonib_reporter.createReport(options) except OONIBReportError: log.err("Error in creating new report") log.msg("We will only create reports to a file") oonib_reporter = None else: oonib_reporter = None yield yaml_reporter.createReport(options) log.msg("Reporting to file %s" % yaml_reporter._stream.name) try: input_unit_factory = InputUnitFactory(test_inputs) input_unit_factory.inputUnitSize = int(cmd_line_options['parallelism']) except Exception, e: log.exception(e)
def runTestCases(test_cases, options, cmd_line_options): log.debug("Running %s" % test_cases) log.debug("Options %s" % options) log.debug("cmd_line_options %s" % dict(cmd_line_options)) test_inputs = options['inputs'] # Set a default reporter if not cmd_line_options['collector'] and not \ cmd_line_options['no-default-reporter']: with open('collector') as f: reporter_url = random.choice(f.readlines()) reporter_url = reporter_url.split('#')[0].strip() cmd_line_options['collector'] = reporter_url oonib_reporter = OONIBReporter(cmd_line_options) yaml_reporter = YAMLReporter(cmd_line_options) if cmd_line_options['collector']: log.msg("Using remote collector, please be patient while we create the report.") try: yield oonib_reporter.createReport(options) except OONIBReportError: log.err("Error in creating new report") log.msg("We will only create reports to a file") oonib_reporter = None else: oonib_reporter = None yield yaml_reporter.createReport(options) log.msg("Reporting to file %s" % yaml_reporter._stream.name) try: input_unit_factory = InputUnitFactory(test_inputs) input_unit_factory.inputUnitSize = int(cmd_line_options['parallelism']) except Exception, e: log.exception(e)