Skip to content

Commit

Permalink
Avoid unnecessary warning about data reporting, when no data is repor…
Browse files Browse the repository at this point in the history
…ted (#277)
  • Loading branch information
smarr authored Jan 9, 2025
2 parents 5d61eee + 9b63ddf commit ab94e43
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rebench/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def output_as_str(string_like):

class UIError(Exception):

def __init__(self, message, exception):
def __init__(self, message, exception = None):
super(UIError, self).__init__()
self._message = message
self._exception = exception
Expand Down
14 changes: 14 additions & 0 deletions rebench/rebench.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,27 @@ def _report_completion(self):
success, _ = rebench_db.send_completion(get_current_time())
return success

@staticmethod
def _make_args_consistent(args):
if args.send_to_rebench_db and (args.no_execution or args.execution_plan):
raise UIError("Trying to send existing data with "
"--no-execution or --execution-plan set is not supported.\n")

if args.no_execution or args.execution_plan:
# no execution, so no need to report data
args.use_data_reporting = False

if args.no_execution and args.execution_plan:
raise UIError("Options --no-execution and --execution-plan are mutually exclusive.\n")

def run(self, argv=None):
if argv is None:
argv = sys.argv

data_store = DataStore(self.ui)
opt_parser = self.shell_options()
args = opt_parser.parse_args(argv[1:])
self._make_args_consistent(args)

cli_reporter = CliReporter(args.verbose, self.ui)

Expand Down

0 comments on commit ab94e43

Please sign in to comment.