def start(args): if args.json_file: results_json = json.load(open(args.json_file, 'r')) if 'debugOutput' in results_json: del results_json['debugOutput'] BenchmarkRunner.show_results(results_json, args.scale_unit, args.show_iteration_values) return if args.allplans: failed = [] skipped = [] planlist = BenchmarkRunner.available_plans() skippedfile = os.path.join(BenchmarkRunner.plan_directory(), 'Skipped') if not planlist: raise Exception('Cant find any .plan file in directory %s' % BenchmarkRunner.plan_directory()) if os.path.isfile(skippedfile): skipped = [ line.strip() for line in open(skippedfile) if not line.startswith('#') and len(line) > 1 ] for plan in sorted(planlist): if plan in skipped: _log.info( 'Skipping benchmark plan: %s because is listed on the Skipped file' % plan) continue _log.info('Starting benchmark plan: %s' % plan) try: run_benchmark_plan(args, plan) _log.info('Finished benchmark plan: %s' % plan) except KeyboardInterrupt: raise except: failed.append(plan) _log.exception('Error running benchmark plan: %s' % plan) if failed: _log.error('The following benchmark plans have failed: %s' % failed) return len(failed) if args.list_plans: list_benchmark_plans() return run_benchmark_plan(args, args.plan)
def __init__(self, args): self._args = args self._plandir = os.path.abspath(BenchmarkRunner.plan_directory()) if not os.path.isdir(self._plandir): raise Exception('Cant find plandir: {plandir}'.format(plandir=self._plandir)) self._parse_config_file(self._args.config_file) # This is the dictionary that will be sent as the HTTP POST request that browserperfdash expects # (as defined in https://github.com/Igalia/browserperfdash/blob/master/docs/design-document.md) # - The bot_* data its obtained from the config file # - the browser_* data is given at startup time via command-line arguments # - The test_* data is generated after each test run. self._result_data = {'bot_id': None, 'bot_password': None, 'browser_id': self._args.browser, 'browser_version': self._args.browser_version, 'test_id': None, 'test_version': None, 'test_data': None}