def ProcessPerfTestOptions(options, args, error_func): """Processes all perf test options. Args: options: optparse.Options object. error_func: Function to call with the error message in case of an error. Returns: A PerfOptions named tuple which contains all options relevant to perf tests. """ # Only one of steps, print_step or single_step must be provided. count = len( filter(None, [options.steps, options.print_step, options.single_step])) if count != 1: error_func( 'Please specify one of: --steps, --print-step, --single-step.') single_step = None if options.single_step: single_step = ' '.join(args[2:]) return perf_test_options.PerfOptions(options.steps, options.flaky_steps, options.print_step, options.no_timeout, options.test_filter, options.dry_run, single_step)
def ProcessPerfTestOptions(options, error_func): """Processes all perf test options. Args: options: optparse.Options object. error_func: Function to call with the error message in case of an error. Returns: A PerfOptions named tuple which contains all options relevant to perf tests. """ if not options.steps and not options.print_step: error_func('Please specify --steps or --print-step') return perf_test_options.PerfOptions(options.steps, options.flaky_steps, options.print_step, options.no_timeout)
def ProcessPerfTestOptions(args): """Processes all perf test options. Args: args: argparse.Namespace object. Returns: A PerfOptions named tuple which contains all options relevant to perf tests. """ # TODO(jbudorick): Move single_step handling down into the perf tests. if args.single_step: args.single_step = ' '.join(args.single_step_command) # TODO(jbudorick): Get rid of PerfOptions. return perf_test_options.PerfOptions( args.steps, args.flaky_steps, args.output_json_list, args.print_step, args.no_timeout, args.test_filter, args.dry_run, args.single_step, args.collect_chartjson_data, args.output_chartjson_data)